Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Test Connection fails from Email Server Profile in Dynamics 365


View products that this article applies to.

Symptom

When using the Test Connection option from an Email Server Profile in Dynamics 365, the test fails and you may see an error like the following example:

"Remote server error: (401) Unauthorized. Make sure the user name and password you entered are correct and try again."

or

"System.Net.WebException: The operation has timed out
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.Crm.Asynchronous.EmailConnector.ExchangeConnectivityDiscoverer.ValidateServerUrl(EmailDirectionCode emailDirection)"

↑ Back to the top


Cause

Cause 1:  The username or password are not correct.

Cause 2: If you are using Dynamics 365 (online) to connect to Exchange on-premises, this error can occur if your firewall does not allow connectivity from Dynamics 365 to your Exchange server.

Cause 3: In some cases, the test connection may fail even though the credentials are correct and connectivity is not a problem. See Resolution 3 in the Resolution section.

↑ Back to the top


Resolution

Resolution 1: Verify the username and password are correct. 

NOTE: The User Name value needs to be in UPN format. Ex. username@contoso.com instead of contoso\username.

Resolution 2: If you are using Dynamics 365 (online) with Exchange on-premises, verify your firewall allows connectivity from the list of IP ranges documented here including the referenced Azure IP ranges:

https://support.microsoft.com/help/2728473  

Resolution 3: The Test Connection results are not always reliable. If the same username and password works when performing a test connection from https://testconnectivity.microsoft.com, use the Test & Enable Mailboxes option in Dynamics 365 instead of the Test Connection option. If the Test & Enable is successful for your mailboxes, you can disregard the results from the Test Connection dialog.

NOTE: If any failures occur using the Test & Enable Mailboxes button, see the Alerts tab within the mailbox record and review any help links that are included.

↑ Back to the top


Keywords: profile, Test Connection, 401

↑ Back to the top

Article Info
Article ID : 4493267
Revision : 7
Created on : 11/15/2019
Published on : 11/15/2019
Exists online : False
Views : 302