简体   繁体   中英

ASP.net SMTP Mail though Proxy

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>

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM