Gmail requires you to use a secure connection. This can be set in your web.config like this:
<network host="smtp.gmail.com" enableSsl="true" ... />
and Programmatically
SmtpClient client = new SmtpClient(server, port);
client.EnableSsl = true;
client.UseDefaultCredentials = false;
// Add credentials if the SMTP server requires them.
client.Credentials = new NetworkCredential(username, password);