当我尝试在Web服务器上找到uplodind之后从我的asp网站发送邮件时,服务器会通过一个异常--->"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 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> <mailSettings> <smtp from="abc@somedomain"> <network host="somesmtpserver" port="25" userName="name" password="pass" defaultCredentials="true" /> </smtp> </mailSettings> </system>
如果需要,请查看此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:发送邮件失败
发布评论