Can't auth to Gmail smtp via MailMessage & smtpClient

后端 未结 11 1359
遇见更好的自我
遇见更好的自我 2020-11-30 06:55

I cannot figure out for the life of my why this isn\'t working

SmtpClient smtp = new SmtpClient
{
    Host = \"smtp.gmail.com\",
    Port = 587,
    UseDefau         


        
11条回答
  •  醉梦人生
    2020-11-30 07:35

    Had the same issue accessing smtp.gmail.com from an ASP.NET application running on Amazon AWS hosting. It turned out that my configuration was right - it was also working fine from another computer - but gmail would deny my login attempt, because I try logging in from an unusual location. I logged on to gmail over the web interface (www.gmail.com), and had to answer a captcha. After that it worked.

提交回复
热议问题