问题:邮件发送失败,头值中找到无效字符
分析:大概率是某些不能使用中文字符的地方使用了中文。
我的问题解决(如下):
MailAddress from = new MailAddress("*****@qq.com", "你好你好");//报错
MailAddress from = new MailAddress("*****@qq.com", "hellohello");//正常
如果不能解决对应问题请检查计算机名是否带有中文,我确认到这个原因也会导致类似的错误出现。
如下是邮件发送的code:
MailAddress from = new MailAddress("*****@qq.com", "hell