How to enable SSL for SmtpClient in Web.config

前端 未结 10 1142
再見小時候
再見小時候 2020-12-05 07:03

Is there a way to set the EnableSSL from the web.config?

I could set this property in code, but that wouldn\'t work for the Simple Mail Web Event and other classes t

10条回答
  •  萌比男神i
    2020-12-05 07:56

    For .NET 3 and earlier: You can't. You have to manage it by hand.

    For more information you can see https://blogs.msdn.microsoft.com/vikas/2008/04/29/bug-asp-net-2-0-passwordrecovery-web-control-cannot-send-emails-to-ssl-enabled-smtp-servers/.

    For .NET 4: You can.

    See http://theoldsewingfactory.com/2011/01/06/enable-ssl-in-web-config-for-smtpclient/

    
        
            
                
                    
                
            
        
    
    

提交回复
热议问题