It might surprise you to find out that sending email using Gmail SMTP can sometimes create an issue for developers and cause them to spend lot of time finding a solution. If you have encountered this issue, there are few important verifications required before you can resolve the problem.
1. UserDefaultCredentials = False, must always appear before Credentials = new System.Net.NetworkCredential. If you insert this below Credentials, it will clear the authentication object and wait for new authentication parameters. Add UserDefaultCredentials before supplying authentication credentials and you will solve this problem.
2. Gmail supports two PORTS for sending an email, 587 and 465. If you trying to send using System.Net.Mail, it will not work with PORT 465, because System.NET.Mail only supports Explicit SSL. You can get more details on Explicit and Implicit SSL from http://blogs.msdn.com/b/webdav_101/archive/2008/06/02/system-net-mail-with-ssl-to-authenticate-against-port-465.aspx, if you need more information. Use port 587, rather than 465 so you do not experience an error, like connection timeout etc.
3. If you have a Google premium account, e.g., name@yourdomain.com, and you don’t have enough rights to allow other applications to send email using your email ID and password, you will need to employ a 2-step verification process so that other apps can send email using your authentication. You should also consider contacting your Administrator to get permission to establish and change settings and allow other application to send email with your authentication. If premium account authentication doesn’t work try a gmail ID like this: name@gmail.com. That should do the trick.