Sending Mail using gmail SMTP from CSharp/.net

前端 未结 3 880
太阳男子
太阳男子 2020-12-20 07:25
using(SmtpClient client = new SmtpClient(\"smtp.gmail.com\", 587)) 
{
    // Configure the client
    client.EnableSsl = true;
    client.UseDefaultCredentials = fal         


        
3条回答
  •  清酒与你
    2020-12-20 08:28

    You need to enable two step authentication for you Gmail account and get application password. Then use that password instead of regular one.

提交回复
热议问题