问题描述
我用的qq邮箱,在win8系统中可以发送,带附件也可以发送,放到windowsserver2003中,不带附件可以发送,带了附件就发不出去,错误信息:System.Net.Mail.SmtpException:Failuresendingmail.--->System.FormatException:Aninvalidcharacterwasfoundinthemailheader:'周'.atSystem.Net.Mime.MailBnfHelper.GetTokenOrQuotedString(Stringdata,StringBuilderbuilder)atSystem.Net.Mime.ContentDisposition.ToString()atSystem.Net.Mime.ContentDisposition.PersistIfNeeded(HeaderCollectionheaders,BooleanforcePersist)atSystem.Net.Mime.MimeBasePart.get_Headers()atSystem.Net.Mime.MimePart.Send(BaseWriterwriter)atSystem.Net.Mime.MimeMultiPart.Send(BaseWriterwriter)atSystem.Net.Mail.Message.Send(BaseWriterwriter,BooleansendEnvelope)atSystem.Net.Mail.SmtpClient.Send(MailMessagemessage)---Endofinnerexceptionstacktrace---atSystem.Net.Mail.SmtpClient.Send(MailMessagemessage)atDataBaseManage.Email.sendEmail(StringsendServer,Int32port,StringsEmail,StringsendPwd,StringcEmail,Stringfiles,StringSubject,StringBody)
解决方案
解决方案二:
Aninvalidcharacterwasfoundinthemailheader:'周'.在邮件头部找到一个非法字符‘周’,这是什么?
解决方案三:
System.FormatException:Aninvalidcharacterwasfoundinthemailheader:'周'.看你文件头,格式异常!
解决方案四:
我也遇到了此问题
解决方案五:
http://write.blog.csdn.net/postlist?t=top&id=37698407