开发者

Debug mode only works sending email in C#

开发者 https://www.devze.com 2023-02-17 00:53 出处:网络
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

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="admin@XXXX.com">
                <network host="smtp.XXXXX.com" port="25"
                         userName="admin@XXXXX.com" password="XXX开发者_如何学GoXX" />
            </smtp>
        </mailSettings>
    </system.net>
    <appSettings/>
    <connectionStrings/>
    <system.web>


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号