First thing you need to remember is, you should keep enable your mail for POP settings in your Gmail account.
then collect following things
1. Receiver Email address
2. Sender Email: UserID and Password
3. Namespace System.Net.Mail
4. Email Attachment if any
check below link
Send Email from your Gmail Account using ASP.NET[
^]
There are many things that can failed your email sending like,
There are so many factor that may affects your email sending code, here is list,
1. Firewall block port 587 (This is port for smtp gmail server)
2. Internet connection is not available on machine or internet connection has face some obstacles while pinging
3. Due to some typo mistake UserName and password may be get wrong
4. Enable SSL is block email sending
5. POP settings for smtp server in your Gmail account is disabled