Sending Mail using gmail SMTP from CSharp/.net

前端 未结 3 874
太阳男子
太阳男子 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:25

    Looks like there is a security issue with Gmail account.

    I have also faced that same issue and then found solution from this post.

    The post mentioned that you need to change the Account Permission setting with "Access of Less secure App" Enabled.

    In fact you will get notification when you logged in to your gmail account.

提交回复
热议问题