I tried to write code for sending an email with .NET. This is what I have so far:
MailMessage mail = new MailMessage("mymailaddress@yahoo.com", address);
mail.Subject = subject;
mail.Body = body;
client.Host = "smtp.gmail.com";
client.Port = 587;
client.Send(e);
The problem is I get the following exception:
Unhandled Exception:
System.Net.Mail.SmtpException
: Failure sending mail.
System.Net.WebException
: Unable to connect to the remote server.
System.Net.Sockets.SocketException
: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond173.194.66.109:587