-1

I am using Office365 SMTPClient to send emails. On the Server machine, I did not find any settings related to TLS enabled or added. I checked through PowerShell command [Net.ServicePointManager]::SecurityProtocol and can see SSL and TLS only. No TLS 1.2 or TLS 1.1 protocol.

My API contains SMTPClient code. So whenever I want to send an email, I just triggered an API call and the mail is shoot.

I checked the value of System.Net.ServicePointManager.SecurityProtocol by printing it in the log of API and it is showing all TLS protocol versions like TLS, TLS1.1,TLS1.2.

Recently,I faced an issue with DB Mail where the database server doesn't have TLS 1.2 enabled so emails were failing to be delivered. I made those settings and it is working fine now.

I just want to find my application is using TLS 1.2 protocol or not.Therefore I checked by printing SecurityProtocol and I find all TLS version. I am little bit confused here because as per my understanding if the server dont have TLS settings then SecurityProtocol would not show TLS version in log.

I checked the server registry and did not find any TLS related DWORDS even I checked through PS script but no luck.

Can you help me here? I want to know is it possible if we don't have registry settings for TLS protocol then how SecurityProcol is showing TLS version?

Thanks in advance.

sujayadkar
  • 63
  • 1
  • 13
  • SmtpClient won't use SSL/TLS unless you tell it to. It's also an obsolete class. The class's own docs advise against using it, saying you should use MailKit instead – Panagiotis Kanavos Mar 31 '22 at 14:45
  • @PanagiotisKanavos I can't move away right now from SmtpCleint. Could you please help me to understand SmtpClient.ServicePoint.ProtocolVersion what does it return. I tried to print the return value it is showing 1.1. I went through MS Docs but did not find its significance. – sujayadkar Mar 31 '22 at 15:52
  • @PanagiotisKanavos If we enableSSL = true for SmtpClient then it uses TLS? – sujayadkar Mar 31 '22 at 16:09

1 Answers1

0

As per my understanding ServicePointManager taking the default operating system protocol.Since I am using dotnet 4.6.1 framework. If the registry does not contain keys for TLS then it meant that TLS is by default enabled on the server and dotnet 4.6.1 can this TLS.

sujayadkar
  • 63
  • 1
  • 13