C#发送邮件异常,返回信息乱码

发邮件时出现了异常:

在 System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
在 System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, MailAddress from, Boolean allowUnicode)
在 System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception)
在 System.Net.Mail.SmtpClient.Send(MailMessage message)

异常信息:System.Net.Mail.SmtpException: 参数或变量中有语法错误。 服务器响应为:���¼exmail.qq.com�޸����� 

排查了很久,最后确定是因为,企业邮箱管理员设置了绑定微信,导致有动态密码导致的。

遇到这种问题,可以问管理员,让管理员查看配置是否有问题。

原文地址:https://www.cnblogs.com/Tpf386/p/7132934.html