How to enable SSL for SmtpClient in Web.config

前端 未结 10 1165
再見小時候
再見小時候 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条回答
  •  余生分开走
    2020-12-05 07:34

    this works for me in .net 4

    E.G. in web.config

    network host="somesmtpserver" userName="do_not_reply@yourserver.com" 
    password="whatever" port="25" enableSsl="true"         
    

提交回复
热议问题