码迷,mamicode.com
首页 > Web开发 > 详细

.Net邮件发送,报错mail from address must be same as authorization

时间:2018-11-02 19:10:08      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:.net   alt   ddr   address   lse   from   分享   bsp   port   

代码:

SmtpClient smtpClient = new SmtpClient();

smtpClient.EnableSsl = true;

smtpClient.UseDefaultCredentials = false;

smtpClient.Host = "smtp.esmail.qq.com";

smtpClient.Port = "25";

smtpClient.Credentials = new System.Net.NetWorkCredential(发送邮件的邮箱,安全码);

smtpClient.Send(msg);

报错:

mail from address must be same as authorization

原因:

发送邮件在设置里开启服务:

技术分享图片

 

.Net邮件发送,报错mail from address must be same as authorization

标签:.net   alt   ddr   address   lse   from   分享   bsp   port   

原文地址:https://www.cnblogs.com/Vibge/p/9897594.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!