Options

SMTP Mail and TLS

FragenFragerFragenFrager Member Posts: 53
edited 2024-04-18 in NAV Three Tier
Hello,
One of our customers wants to switch his email delivery to Exchange Online. However, when sending the test email in the SMTP setup, he received the following message:

"The mail system returned the following error: "Error sending mail. Authentication failed because the other party closed the transport stream."

After some Googling, I came to the solution of specifying TLS version 12 explicitly in the code via the following line in the TrySend function in the CU400
ServicePointManager.SecurityProtocol := 3072; // 3072 = Tls12 (TLS 1.2)
It works this way, but I don't really like it because...
    - this forces me to use a specific TLS version, which is not recommended by Microsoft. However, it doesn't say how I read the TLS version from the operating system.
    - I "mess up" a standard object. Unfortunately, the CU400 does not seem to offer any events in this version that you could subscribe to

Does anyone here know a slightly smoother solution?
Sign In or Register to comment.