Exchange emails not sending - Send Email Failure
kbt170851
PRODUCTIssue
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 FilesK2Host ServerBin","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 FilesK2Host ServerBin",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 FilesK2Host ServerBin","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 FilesK2Host ServerBin"
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: