System.Net.Mail.SmtpException:发送邮件失败

编程入门 行业动态 更新时间:2024-10-19 14:40:36
本文介绍了System.Net.Mail.SmtpException:发送邮件失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

当我尝试在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:发送邮件失败

本文发布于:2023-11-17 12:18:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1609979.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:发送邮件   Net   System   SmtpException   Mail

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!