Email Sending Failure in K2 specifically with Exchange Online and sometimes Exchange OnPrem(SSL) - Unable to discover the EWS
kbt154459
PRODUCTIssue
Email notifications are not being sent by workflow at runtime. This includes Client Notification(Task Notification) emails, Escalation(Reminder) emails, and Email Event notification emails.
Symptoms
This ONLY applies to environments that are routing K2 traffic through a proxy that is non-SSL. Doing so will consequently strip out the SSL/HTTPS binding off the EWS URL address for Exchange Online, or Exchange OnPrem with SSL configured, and cause the system to throw the error exceptions below in the K2 hostserver logs:
"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 remote server returned an error: (400) Bad Request.","anonymous"
"Send Failure: EWS URL is not valid. Verify the connection strings are correct. Exception: The request failed. The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel." "MessageBus","61012","ConnectionError","ExchangeWebServicesOrigin","61012 Exception from message source username@domainname.com: Microsoft.Exchange.WebServices.Data.AutodiscoverLocalException: The Autodiscover service couldn't be located.
Resolution
You will need to either use an SSL enabled proxy server or disable it altogether in order to negate the issue.
In a scenario where the proxy server implementation is configured for SSL, and you are seeing a similar error in the logs, check to make sure the SSL certificate is not expired.
However, if this is not the case for your particular scenario, please see the following article for alternate resolution/troubleshooting ideas: