Can't auth to Gmail smtp via MailMessage & smtpClient

后端 未结 11 1366
遇见更好的自我
遇见更好的自我 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

    My problem was that the domain-owner for our gmail-account had disabled both "Access for less secure apps" and two step authentication. There was no way to enable it, I couldn't even see the setting. So I tested with my personal account instead, and it worked fine.

提交回复
热议问题