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

推荐订阅源

Forbes - Security
Forbes - Security
A
Arctic Wolf
M
MIT News - Artificial intelligence
T
Threat Research - Cisco Blogs
T
The Exploit Database - CXSecurity.com
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
L
Lohrmann on Cybersecurity
Martin Fowler
Martin Fowler
A
About on SuperTechFans
P
Palo Alto Networks Blog
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
WordPress大学
WordPress大学
Blog — PlanetScale
Blog — PlanetScale
博客园_首页
大猫的无限游戏
大猫的无限游戏
Cisco Talos Blog
Cisco Talos Blog
P
Proofpoint News Feed
D
DataBreaches.Net
Cyberwarzone
Cyberwarzone
T
Tor Project blog
IT之家
IT之家
P
Proofpoint News Feed
Help Net Security
Help Net Security
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
CXSECURITY Database RSS Feed - CXSecurity.com
Microsoft Azure Blog
Microsoft Azure Blog
V2EX - 技术
V2EX - 技术
K
Kaspersky official blog
Hugging Face - Blog
Hugging Face - Blog
MongoDB | Blog
MongoDB | Blog
B
Blog
N
News and Events Feed by Topic
The Cloudflare Blog
S
Schneier on Security
P
Privacy & Cybersecurity Law Blog
T
The Blog of Author Tim Ferriss
Recorded Future
Recorded Future
Last Week in AI
Last Week in AI
The Last Watchdog
The Last Watchdog
Hacker News - Newest:
Hacker News - Newest: "LLM"
L
LangChain Blog
I
InfoQ
F
Full Disclosure
The Register - Security
The Register - Security
阮一峰的网络日志
阮一峰的网络日志
H
Hacker News: Front Page
V
V2EX

博客园 - 蒜头

再谈Images到xps,pdf的转换 SQL Server 2005中xml类型和函数的简单应用 部分Office 2007文件格式转换为xps和pdf代码整理 Image.FromFile gives "Out of Memory" Exception for icon - 蒜头 简单介绍PDF,XPS,Images,Office 2007之间的转换方法 - 蒜头 - 博客园 SQL 2005 全文检索(续) 简单实现C#生成Excel 2007文件并下载 简单应用ReportViewer控件 配置SQL Server Session方法 采用负载均衡,部署了两个ASP.NET 2.0的站点服务器碰到的问题 初试VSTS 2008(TFS安装) Windows Server 2003分区修改方法[转载] 制作VSTO 2005 SE开发的Office 2007 AddIn的安装包 一个简单的document library event handler VS 2005 SP1 安装错误 [续] 一个简单的Checkbox Custom Field Type ASP.NET 2.0 SQL Cache 配置方法 解读Document Library关于权限的对象模型 SharePoint应用AJAX.NET和AJAX Control Toolkit
Mailbox unavailable. The server response was: 5.7.1 Unable to relay for (email address).
蒜头 · 2008-05-30 · via 博客园 - 蒜头

在发送email时得到这个异常,
Mailbox unavailable. The server response was: 5.7.1 Unable to relay for (email address).

解决办法是添加一句代码:

client.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;

新代码如下:

            MailMessage message = new MailMessage(from, to, subject, body);
            SmtpClient client 
= new SmtpClient();
            client.DeliveryMethod 
= SmtpDeliveryMethod.PickupDirectoryFromIis;

            message.IsBodyHtml 
= true;
            client.Send(message);

发信正常了:)