problem sending mail from my website using gmail-mailservers
I want to use gmail-mail servers, I have registrated to google app and I have my company mails in gmail.
iam getting this error: System.N开发者_运维知识库et.WebException: The remote name could not be resolved: 'smtp.gmail.com'
WHy is this not working, Iam using the email and password
MailMessage message = new MailMessage(from, to, subject, body);
message.IsBodyHtml = true;
message.Priority = MailPriority.High;
SmtpClient mailClient = new SmtpClient();
mailClient.Credentials = new System.Net.NetworkCredential
("___@gmail.com", "__________");
mailClient.Port = 587;
mailClient.Host = "smtp.gmail.com";
mailClient.EnableSsl = true;
mailClient.Send(message);
message.Dispose();
精彩评论