After updating SSL Settings Can't Send Email Through SMTP

时间:2015-11-18 21:03:56

标签: c# ssl smtpclient

I run a server at home using IIS7.5 and recently ran an SSL test (https://www.ssllabs.com/ssltest) on it. It came back with a recommendation to change the cipher suites that I use to eliminate deprecated ones from being used. I followed the instructions from here: https://weakdh.org/sysadmin.html (scroll down to Microsoft IIS). The cipher suites that I am now using came from here: https://weakdh.org/sysadmin.html under 1.1 Modern Compatibility. Obviously that is the most restrictive.

Now, when I attempt to send an email using SmptClient I get the following error:

A call to SSPI failed, see inner exception.

Inner Exception:

The client and server cannot communicate, because they do not possess a common algorithm

I'm sending the emails through smtp.gmail.com which I would assume supports modern cipher suites (bad assumption?).

1 个答案:

答案 0 :(得分:0)

您使用什么.NET版本? .NET 4.6自动使用TLS 1.2,但默认情况下,如.NET 4.5之类的较早版本不使用TLS 1.2。希望对您有所帮助。

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; // .NET 4.5
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072; // .NET 4.0