Thursday, February 3, 2022

Dynamics NAV Error : The SMTP mail system returned the following error: "Failure sending mail. Unable to read data from the transport connection: net_io_connectionclosed."

Hello Friends,

From last days we recently start getting below error in Dynamics NAV while sending any email

Microsoft Dynamics NAV

---------------------------

The SMTP mail system returned the following error: "Failure sending mail.

Unable to read data from the transport connection: net_io_connectionclosed.".

---------------------------

OK

---------------------------







Reason: TLS 1.0 and TLS 1.1 is now deprecated by Microsoft.

Exchange Online no longer supports use of TLS1.0 and TLS1.1 in the service as of October 2020. This change is due to security and compliance requirements for our service. While no longer supported, our servers still allow clients to use those older versions of TLS when connecting to the SMTP AUTH endpoint (smtp.office365.com).

In 2022, we plan to completely disable those older TLS versions to secure our customers and meet those security and compliance requirements. However, due to significant usage, we've created an opt in endpoint that legacy clients can use with TLS1.0 and TLS1.1. Note that this endpoint is not available in GCC, GCC-High, or DoD environments that have legacy TLS permanently turned off.

======================

Solution

1) You need update on Microsoft Exchange to allow Legacy TLS 1.0 and 1.1

Refer this Mirosoft Blog for same

https://docs.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/opt-in-exchange-online-endpoint-for-legacy-tls-using-smtp-auth

https://office365itpros.com/2021/08/19/exchange-online-to-introduce-legacy-smtp-endpoint-in-2022/

https://techcommunity.microsoft.com/t5/exchange-team-blog/new-opt-in-endpoint-available-for-smtp-auth-clients-still/ba-p/2659652

2) If customers have SMTP AUTH clients that only support older TLS versions, they need to be configured to use the new endpoint:  (on SMTP Setup page change SMTP Server)

 smtp-legacy.office365.com

3) In Dynamics NAV Customsettings.config file add below key (optional)

 <add key="SecurityProtocol" value="Tls12" />

I would suggest you to please upgrade your platform build of NAV 2016 to last CU 67.

Download Link: 

https://support.microsoft.com/en-us/topic/cumulative-update-67-for-microsoft-dynamics-nav-2016-build-52168-7d252e03-84ea-434b-8da7-257ccdde9356

=============

GMAIL user can do below change for solve issue

I had a similar problem with Gmail a while ago. This ended up being the solution as Google had increased their email app security (working as of Sept 2016):

Using this Google MyAccount Page

  1. From your Gmail page, click the avatar image for your account in the upper right corner.
  2. Press 'My Account.'
  3. Press 'Sign In & Security.'
  4. Scroll down to 'Connected Apps & Sites' section.
  5. Toggle 'Allow Less Secure Apps' to On.

https://support.google.com/accounts/answer/6010255?hl=en

https://stackoverflow.com/questions/39454422/gmail-unable-to-read-data-from-the-transport-connection-net-io-connectionclose/39454921

================================


Done...

You are now good to go after make above changes

Email sending will work fine.

Thank you for reading

Keep Sharing....Keep Growing...