ASP.net SMTP Mail though Proxy

眉间皱痕 提交于 2019-12-18 09:44:14

问题


How to setup SMTPClient in ASP.net with C# to send email with provided proxy address ? or sending by detecting the system default proxy

I used the the following code in web.config but didnt work

<system.net>
    <defaultProxy enabled="true">
      <proxy bypassonlocal="False" proxyaddress="http://192.168.101.3:8080/" />
    </defaultProxy>
  </system.net>

回答1:


You can't send SMTP email through an HTTP proxy server.

Speak to the person administering your Internet gateway/firewall to ask what host they want you to direct outbound email to.




回答2:


Based on this article, you simply have to declare your proxy configuration into your Web.config and try to change the port:

If you are still having problems them try changing port number to 587

Edited my answer after your edit.



来源:https://stackoverflow.com/questions/8501014/asp-net-smtp-mail-though-proxy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!