This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice This article is not considered official documentation for K2 software and is provided "as is" with no warranties.

Issue

After setting up K2 on a new environment and testing the EWS connection within the setup manager using the test button, when starting a workflow that has a mail event in it to see if the EWS set is correct, you will see that the workflow fails with the following error:

Sourcecode.Workflow.Common.EWS: Autodiscover failure: The exchange server is not available, the password is incorrect or the email address (Specified) does not exist.

Checking on the connection string editor you see that the settings provided appear to be fine.

Symptoms

When looking in the K2 logs you will see the following here as well:

"Error","General","0","ErrorMessage","SourceCode.Workflow.Common.EWS: ","0 Mail send failure: EWS URL is not valid. Verify the connection strings are correct. Exception: The request failed. The underlying connection was closed: An unexpected error occurred on a receive.","anonymous","0.0.0.0","NTK2:C:\Program Files\K2\Host Server\Bin","5987050","","Error","General","0","ErrorMessage","SourceCode.Workflow.Common.EWS: ","0 Mail send failure: EWS URL is not valid. Verify the connection strings are correct. Exception: The request failed. The underlying connection was closed: An unexpected error occurred on a receive.","anonymous","0.0.0.0","NTK2:C:\Program Files\K2\Host Server\Bin",10:19:46","Warning","General","0","WarningMessage","SourceCode.Workflow.Common.EWS: ","0 Autodiscover used to determine valid EWS URL. Reconfigure K2 server to cache updated EWS URL and prevent autodiscover calls.","anonymous","0.0.0.0","NTK2:C:\Program Files\K2\Host Server\Bin","5987052","d458444f9b884b84ae5c4db24f6755a6","" ,"Warning","General","0","WarningMessage","SourceCode.Workflow.Common.EWS: ","0 Autodiscover used to determine valid EWS URL. Reconfigure K2 server to cache updated EWS URL and prevent autodiscover calls.","anonymous","0.0.0.0","NTK2:C:\Program Files\K2\Host Server\Bin"

Troubleshooting Steps

It appears that this issue is caused by the TLS version used on the environment. It is a good idea to also check if TLS 1.0 is enabled, as it may be disabled on Windows server 2016 by default.

If this does turn out to be the case, then TLS 1.0 will have to be re-enabled. Afterwards when retrying the workflow test instances, emails should send as expected.

There are further guides which Microsoft have compiled in regards to this:

https://blogs.msdn.microsoft.com/sqlreleaseservices/tls-1-2-support-for-sql-server-2008-2008-r2-2012-and-2014/