调试模式仅适用于在 C# 中发送电子邮件
我编写了一个发送电子邮件功能,该功能仅适用于我的调试模式(调试本地服务器),当我发布和托管该功能不起作用的 C# 代码时。这是我的电子邮件配置功能
<configuration>
<system.net>
<mailSettings>
<smtp from="[email protected]">
<network host="smtp.XXXXX.com" port="25"
userName="[email protected]" password="XXXXX" />
</smtp>
</mailSettings>
</system.net>
<appSettings/>
<connectionStrings/>
<system.web>
i wrote a sending email function that only works on my debug mode(debug local server) when i publishing and hosting C# code that function doesn't work. This is my email configuration function
<configuration>
<system.net>
<mailSettings>
<smtp from="[email protected]">
<network host="smtp.XXXXX.com" port="25"
userName="[email protected]" password="XXXXX" />
</smtp>
</mailSettings>
</system.net>
<appSettings/>
<connectionStrings/>
<system.web>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我多次发现防火墙或防病毒软件(内置防火墙)可能会阻止传出 smtp 流量。您可能还需要与网络管理员核实邮件服务器是否允许来自您发送邮件的服务器的 smtp 流量。
I have found a lot of times that there can be a firewall or antivirus (with built in firewall) blocking outgoing smtp traffic. You may also want to check with the network administrator that the mail server will allow smtp traffic from the server you are sending from.