如何解决System.Net.Mail.SmtpException:'SMTP服务器需要安全连接,或者服务器响应为:#5.7.0必须首先发出STARTTLS命令'
该错误的解决方案是什么。
System.Net.Mail.SmtpException: 'The SMTP server requires a secure connection or The server response was: #5.7.0 Must issue a STARTTLS command first'
使用(var smtpclient = new CvxSmtpClient("username","password",587))
message.Body = email.message;
smtpclient.EnableSsl = false;
smtpclient.Send(message);
var param = new SqlParameter();
param.ParameterName = "@id";
param.Value = email.id;
db.ExecuteSql(queryUpdateEmailsToSend,param);
解决方法
SMTP服务器拒绝不安全的连接。
您设置了smtpclient.EnableSsl = false
,所以SmtpClient
不使用SSL。尝试将其设置为true
。
有关更多详细信息,请查看文档:{{3}}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。