System.Net.Mail.SmtpException:发送邮件失败 [英] System.Net.Mail.SmtpException:Failure sending mail

查看:521
本文介绍了System.Net.Mail.SmtpException:发送邮件失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在Web服务器上找到uplodind之后从我的asp.net网站发送邮件时,服务器会通过一个异常--->"System.Net.Mail.SmtpException:发送邮件失败.---> ; System.Net.WebException:无法连接到远程服务器---> System.Net.Sockets.SocketException:连接尝试失败是因为被连接的一方在一段时间后未正确响应,或者建立的连接失败是因为连接的主机未能响应209.173.141.250:25"
但是,当我通过计算机编译该代码时,它就可以正常工作.
谁能告诉我该怎么做才能解决此问题.

when i am trying to send mail from my asp.net web site after uplodind on the web server then server throughs an exception--->"System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 209.173.141.250:25"
But when i compaile that code through my computer it works proper.
can any one tell me what to do to solve this problem.

推荐答案

这可能是由于各种原因造成的.您需要一一看待它们.
港口开放吗?防火墙权限到位了吗?
进一步确保已在Web.Config中配置SMTP配置:
It can be because of various reasons. You need to look at them one by one.
Is the port open? Firewall permissions in place?
Further make sure you have configured SMTP configuration in Web.Config:
<system.net>
   <mailSettings>
     <smtp from="abc@somedomain.com">
       <network host="somesmtpserver" port="25" userName="name" password="pass" defaultCredentials="true" />
     </smtp>
   </mailSettings>
</system.net>


如果需要,请查看此Microsoft Video教程:
使用ASP.NET发送来自网站的电子邮件 [在ASP.NET中发送电子邮件的教程 [


If needed, have a look at this Microsoft Video tutorial:
Use ASP.NET to send Email from Website[^]
Tutorials on sending Email in ASP.NET[^]


您是否正在使用McAfee?
默认情况下,它阻止端口25.
您需要更改McAfee设置.
Are you using McAfee?
By default it blocks port 25.
You Need to change McAfee Settings.


这篇关于System.Net.Mail.SmtpException:发送邮件失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆