Mailbox unavailable. The server response was: 5.7.1 Unable to relay for (email address).
2008-05-30 19:26
686 查看
在发送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);
发信正常了:)
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);
发信正常了:)
相关文章推荐
- Mailbox unavailable. The server response was: 5.7.1 Unable to relay for info@site.com
- 解决lumisoft mail server使用中的错误“550 5.7.1 Unable to relay for xxx”
- Mailbox unavailable. The server response was: 5.1.1 User unknown
- ArcGIS for Server 创建站点失败The server was unable to access the URL: 'https://ip:6443/arcgis/services'
- WCF分布式开发常见错误(12):The server was unable to process the request,服务无法处理请求
- Secret from which the Mail-to-Blogger email address is derived
- WCF分布式开发常见错误解决(12):The server was unable to process the request,服务无法处理请求
- Unable to load the native wlfileio library for the persistent file store "_WLS_AdminServer"
- Zend Server 错误:The server encountered an internal error or misconfiguration and was unable to comple
- 【错误】:Could not open JDBC Connection for transaction; nested exception is: Communications link failure;The last packet sent successfully to the server was 1 milliseconds ago
- Unable to start debugging on the web server. You do not have permission to debug the application. The URL for this project is in
- 解决方案Server Tomcat v7.0 Server at localhost was unable to start within 45 seconds. If the server requ
- commons-mail报错,提示EmailException: Sending the email to the following server failed
- 修复VirtualBox "This kernel requires the following features not present on the CPU: pae Unable to boot – please use a kernel appropriate for your CPU"(安装深度Linux的时候就需要)
- 修复VirtualBox "This kernel requires the following features not present on the CPU: pae Unable to boot – please use a kernel appropriate for your CPU"
- Server Tomcat v6.0 Server at localhost was unable to start within 45 seconds. If the server requires
- 装带sp1的英文版Sharepoint,安装必备组件时候遇到The tool was unable to install Hotfix for Microsoft Windows (KB976462)错误
- Unable to start debugging on the web server. The IIS worker process for the launched URL is not currently running
- Vagrant was unable to mount VirtualBox shared folders. This is usually because the filesystem "vboxs
- Server MyEclipse Tomcat v7.0 was unable to start within 45 seconds. If the server requires more time