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

推荐订阅源

月光博客
月光博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
V
Vulnerabilities – Threatpost
L
LangChain Blog
Stack Overflow Blog
Stack Overflow Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
云风的 BLOG
云风的 BLOG
C
Cisco Blogs
V
Visual Studio Blog
L
Lohrmann on Cybersecurity
Latest news
Latest news
S
Securelist
The Last Watchdog
The Last Watchdog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
The Register - Security
The Register - Security
Webroot Blog
Webroot Blog
The Cloudflare Blog
S
Secure Thoughts
Y
Y Combinator Blog
aimingoo的专栏
aimingoo的专栏
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
N
News and Events Feed by Topic
S
Security Affairs
Attack and Defense Labs
Attack and Defense Labs
Microsoft Azure Blog
Microsoft Azure Blog
T
Tailwind CSS Blog
V2EX - 技术
V2EX - 技术
GbyAI
GbyAI
L
LINUX DO - 热门话题
PCI Perspectives
PCI Perspectives
Schneier on Security
Schneier on Security
V
V2EX
K
Kaspersky official blog
Hugging Face - Blog
Hugging Face - Blog
AWS News Blog
AWS News Blog
T
The Exploit Database - CXSecurity.com
C
CERT Recently Published Vulnerability Notes
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Proofpoint News Feed
T
Threatpost
WordPress大学
WordPress大学
SecWiki News
SecWiki News
B
Blog RSS Feed
Blog — PlanetScale
Blog — PlanetScale
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
A
Arctic Wolf
酷 壳 – CoolShell
酷 壳 – CoolShell
W
WeLiveSecurity
Jina AI
Jina AI
D
Darknet – Hacking Tools, Hacker News & Cyber Security

博客园 - 破宝

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