加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – 如何使用TLS电子邮件与web.config

发布时间:2020-12-16 00:27:12 所属栏目:asp.Net 来源:网络整理
导读:这是我的web.config文件: system.net mailSettings smtp from="xxx@gmail.com" network host="smtp.gmail.com" port="587" userName="xxx@gmail.com" password="yyy" / /smtp /mailSettings/system.net 我需要启用TLS,这是我的电子邮件服务器的要求。但是
这是我的web.config文件:
<system.net>
    <mailSettings>
        <smtp from="xxx@gmail.com"  >
            <network host="smtp.gmail.com" port="587" userName="xxx@gmail.com" password="yyy" />
        </smtp>
    </mailSettings>
</system.net>

我需要启用TLS,这是我的电子邮件服务器的要求。但是我只看到SSL。

解决方法

它实际上是等价的 – TLS比SSL更广泛。所以使用enableSsl =“true”启用TLS。根据 MSDN documentation,这将强制SMTPClient使用 RFC 3207
(和RFC使用两个术语TLS / SSL)。
<network enableSsl="true" host="smtp.gmail.com" port="587" ...

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读