System.Net.Mail发邮件异常,求帮助

abc4403022 2013-07-08 11:51:46
我用的qq邮箱,在win8系统中可以发送,带附件也可以发送,
放到windows server2003中,不带附件可以发送,带了附件就发不出去,错误信息:


System.Net.Mail.SmtpException: Failure sending mail. ---> System.FormatException: An invalid character was found in the mail header: '周'.
at System.Net.Mime.MailBnfHelper.GetTokenOrQuotedString(String data, StringBuilder builder)
at System.Net.Mime.ContentDisposition.ToString()
at System.Net.Mime.ContentDisposition.PersistIfNeeded(HeaderCollection headers, Boolean forcePersist)
at System.Net.Mime.MimeBasePart.get_Headers()
at System.Net.Mime.MimePart.Send(BaseWriter writer)
at System.Net.Mime.MimeMultiPart.Send(BaseWriter writer)
at System.Net.Mail.Message.Send(BaseWriter writer, Boolean sendEnvelope)
at System.Net.Mail.SmtpClient.Send(MailMessage message)
--- End of inner exception stack trace ---
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at DataBaseManage.Email.sendEmail(String sendServer, Int32 port, String sEmail, String sendPwd, String cEmail, String files, String Subject, String Body)
...全文
998 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
dclcl 2014-07-11
  • 打赏
  • 举报
回复
http://write.blog.csdn.net/postlist?t=top&id=37698407
errolsun 2013-09-27
  • 打赏
  • 举报
回复
我也遇到了此问题
Regan-lin 2013-07-09
  • 打赏
  • 举报
回复
System.FormatException: An invalid character was found in the mail header: '周'. 看你文件头,格式异常!
全栈极简 2013-07-09
  • 打赏
  • 举报
回复
An invalid character was found in the mail header: '周'. 在邮件头部找到一个非法字符‘周’,这是什么?

110,539

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧