开发者

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();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜