First of all, you need need to set something in your gmail account to enable sending email using asp.net
1. Open you gmail account and go to setting
2. Click on Forwarding and POP/IMAP
3. Choose Enable POP for mail that arrives from now on
4. Click save changes

Here is the code for sending email from asp.net by using gmail account