Debug mode only works when sending email in C #

I wrote an email sending function that only works in my debug mode (debugging a local server) when I publish and post C # code that doesn't work. This is my email setup feature

<configuration>
    <system.net>
        <mailSettings>
            <smtp from="admin@XXXX.com">
                <network host="smtp.XXXXX.com" port="25"
                         userName="admin@XXXXX.com" password="XXXXX" />
            </smtp>
        </mailSettings>
    </system.net>
    <appSettings/>
    <connectionStrings/>
    <system.web>
+3
source share
1 answer

I have found many times that there may be a firewall or an antivirus (with a built-in firewall) blocking outgoing smtp traffic. You can also check with your network administrator that the mail server will allow SMTP traffic from the server from which you are sending.

+3
source

All Articles