如何在Web.config中启用SSL SmtpClient [英] How to enable SSL for SmtpClient in Web.config
问题描述
有没有办法从web.config中设置EnableSSL?
Is there a way to set the EnableSSL from the web.config?
我可以设置该属性在code,但不会为使用默认的SMTP服务器的简单邮件Web事件和其他类的工作。任何想法?
I could set this property in code, but that wouldn't work for the Simple Mail Web Event and other classes that uses the default Smtp Server. Any ideas?
推荐答案
有关.NET 3和更早版本:不能。你必须用手工来管理它。
For .NET 3 and earlier: You can't. You have to manage it by hand.
有关更多信息,你可以看到<一href="http://robertseder.spaces.live.com/blog/cns!587F478B9240C01E!270.entry">http://robertseder.spaces.live.com/blog/cns!587F478B9240C01E!270.entry.
For more information you can see http://robertseder.spaces.live.com/blog/cns!587F478B9240C01E!270.entry.
有关.NET 4:可以。
For .NET 4: You can.
请参阅<一href="http://theoldsewingfactory.com/2011/01/06/enable-ssl-in-web-config-for-smtpclient/">http://theoldsewingfactory.com/2011/01/06/enable-ssl-in-web-config-for-smtpclient/
这篇关于如何在Web.config中启用SSL SmtpClient的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!