Persits Software, Inc. Knowledge Base Articles

Fatal alert received from the server: handshake failure error

Problem Description

When trying to send an email message with AspEmail or AspEmail.NET, the following error is generated:

Transport Layer Security Error #39 (TLS): Fatal alert received from the server: handshake_failure.

Solution

In most cases, this error means that your SMTP server expects TLS 1.2 while the current version of AspEmail (or AspEmail.NET) only supports TLS 1.0, or TLS 1.2 is not enabled.

As of Version 5.5, AspEmail supports both TLS 1.0 and TLS 1.2, and TLS 1.2 is the default mode. If you are using a version prior to 5.5, you need to upgrade to the latest version (upgrading is free). If you are already using AspEmail 5.5+, make sure the property Mail.TLSVersion is not explicitly set to "1.0" in your script.

If you are seeing the aforementioned error in the EmailAgent.NET log, make sure you are using EmailAgent.NET 5.5+ and, in your script, the Host address is appended with two spaces to enable TLS 1.2, as follows:

Mail.Host = "smtp.myserver.com " ' two trailing spaces