惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
IT之家
IT之家
V
V2EX
Jina AI
Jina AI
V
Visual Studio Blog
有赞技术团队
有赞技术团队
博客园 - 司徒正美
博客园 - 叶小钗
The Cloudflare Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
小众软件
小众软件
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Google DeepMind News
Google DeepMind News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
腾讯CDC
Google Online Security Blog
Google Online Security Blog
博客园 - 【当耐特】
Apple Machine Learning Research
Apple Machine Learning Research
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
N
News and Events Feed by Topic
N
News and Events Feed by Topic
The Last Watchdog
The Last Watchdog
W
WeLiveSecurity
月光博客
月光博客
Security Archives - TechRepublic
Security Archives - TechRepublic
Webroot Blog
Webroot Blog
SecWiki News
SecWiki News
博客园_首页
罗磊的独立博客
量子位
Latest news
Latest news
I
Intezer
V
Vulnerabilities – Threatpost
A
Arctic Wolf
Last Week in AI
Last Week in AI
Recent Commits to openclaw:main
Recent Commits to openclaw:main
S
SegmentFault 最新的问题
S
Security Affairs
阮一峰的网络日志
阮一峰的网络日志
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
酷 壳 – CoolShell
酷 壳 – CoolShell
P
Palo Alto Networks Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
N
News | PayPal Newsroom

博客园 - 破宝

imdict-chinese-analyzer .NET转写版 SQLite全文检索(2) SQLite全文检索(1) 80块钱毁掉“猪八戒”的信誉 有点郁闷:MSDN文档中MidpointRounding.AwayFromZero的翻译错误 当 ASP.net Mobile Controls 碰到“中国特色”的 CMWAP / UNIWAP 闲话“正版”:正版软件和盗版软件的区别到底是什么? 闲话“正版”:真是因为“缺钱”吗? 又一个疑似Bug: XmlDataSource 控件的 Data 属性动态改变时,缓存不会自动失效 About GridView, HyperLinkField, UrlEncode 关于 GridView,HyperLinkField,UrlEncode WPF教程(译文)(第二部分) 破宝(percyboy)的自选精华版 破宝(percyboy)的留言板(2008/3~) WPF 教程(译文)(第一部分) Atlas 学习记录 ajaxnet4j beta Releases -- A Java Implementation of Ajax.NET Professional Library 好消息:Ajax.NET Professional open-sourced 及 ajaxnet4j 即将发布 NDoc Reloading: Kevin 留给我们的 NDoc 2.0 Alpha
立此存照:System.Net.Mail 的 bug
破宝 · 2008-06-10 · via 博客园 - 破宝

痛苦了debug了一个多钟头,后来终于在网络上找到了这篇“救星”文章:

http://columns.chicken-house.net/blogs/chicken/archive/2007/04/06/system-net-mail-bug.aspx

立此存照,如果您也碰到同样问题,希望能够能比我更幸运些,更早找到问题所在。

症状是:调用 SmtpClient.Send 方法后,出现 System.FormatException,

英文消息为“An invalid character was found in header value.

中文消息是:“邮件标头中找到无效字符”。

原因是在 SmtpClient.Send 之前曾经调用过该 MailMessage 对象的 From, To, Cc 等字段的 ToString 方法。很有可能的情形是,你尝试在发信前留下日志时,“无意间”调用到了。而微软的工程师在此处出现了一些失误,最终产生了该错误消息,具体情况请参看上面链接中的文章。

P.S. 当然还会有其他原因可能导致此问题,比如微软知识库里给出的一种原因是因为收件人显示名称中包含有引号