|
1 | 1 | --- |
2 | | -title: Test Connection fails from Email Server |
3 | | -description: Provides a solution to an issue where Test Connection fails from Email Server Profile in Microsoft Dynamics 365. |
| 2 | +title: Test Connection fails in email server profile |
| 3 | +description: Provides a solution to an issue where test connection fails from an email server profile in Microsoft Dynamics 365. |
4 | 4 | ms.reviewer: |
5 | 5 | ms.date: 12/05/2024 |
6 | 6 | ms.custom: sap:Email and Exchange Synchronization |
7 | 7 | --- |
8 | | -# Test Connection fails from Email Server Profile in Microsoft Dynamics 365 |
| 8 | +# Test Connection fails with 401 or timeout error in email server profile in Microsoft Dynamics 365 |
9 | 9 |
|
10 | | -This article provides a solution to an issue where Test Connection fails from Email Server Profile in Microsoft Dynamics 365. |
| 10 | +This article provides a solution to an issue where **Test Connection** fails from an email server profile in Microsoft Dynamics 365. |
11 | 11 |
|
12 | 12 | _Applies to:_ Microsoft Dynamics 365 |
13 | 13 | _Original KB number:_ 4493267 |
14 | 14 |
|
15 | 15 | ## Symptoms |
16 | 16 |
|
17 | | -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: |
| 17 | +When you select **Test Connection** on an email server profile record in Dynamics 365, the test fails and you might see one of the following errors: |
18 | 18 |
|
19 | | -> "Remote server error: (401) Unauthorized. Make sure the user name and password you entered are correct and try again." |
20 | | -or |
| 19 | +> Remote server error: (401) Unauthorized. Make sure the user name and password you entered are correct and try again. |
21 | 20 |
|
22 | | -> "System.Net.WebException: The operation has timed out |
23 | | -at System.Net.HttpWebRequest.GetResponse() |
24 | | -at Microsoft.Crm.Asynchronous.EmailConnector.ExchangeConnectivityDiscoverer.ValidateServerUrl(EmailDirectionCode emailDirection)" |
| 21 | +Or |
25 | 22 |
|
26 | | -## Cause |
| 23 | +> System.Net.WebException: The operation has timed out |
| 24 | +> at System.Net.HttpWebRequest.GetResponse() |
| 25 | +> at Microsoft.Crm.Asynchronous.EmailConnector.ExchangeConnectivityDiscoverer.ValidateServerUrl(EmailDirectionCode emailDirection) |
27 | 26 |
|
28 | | -- **Cause 1:** The username or password isn't correct. |
29 | | -- **Cause 2:** If you're using Dynamics 365 (online) to connect to Exchange on-premises, this error can occur if your firewall doesn't allow connectivity from Dynamics 365 to your Exchange server. |
30 | | -- **Cause 3:** In some cases, the test connection may fail even though the credentials are correct and connectivity isn't a problem. See Resolution 3 in the Resolution section. |
| 27 | +## Cause 1: Incorrect username or password |
31 | 28 |
|
32 | | -## Resolution |
| 29 | +To solve this issue, verify the username and password are correct. |
33 | 30 |
|
34 | | -- **Resolution 1:** Verify the username and password are correct. |
| 31 | +> [!NOTE] |
| 32 | +> The **User Name** value needs to be in the UPN (User Principal Name) format. For example, use `[email protected]` instead of `contoso\username`. |
35 | 33 |
|
36 | | - > [!NOTE] |
37 | | - > The User Name value needs to be in UPN (User Principal Name) format. Ex. `[email protected]` instead of `contoso\username`. |
| 34 | +## Cause 2: Firewall blocking connectivity |
38 | 35 |
|
39 | | -- **Resolution 2**: If you're using Dynamics 365 (online) with Exchange on-premises, verify your firewall allows connectivity from the list of IP ranges documented in [Microsoft Dynamics CRM Online IP Address Ranges](https://support.microsoft.com/help/2728473) including the referenced [Azure IP ranges](https://support.microsoft.com/help/2728473). |
| 36 | +If you're using Dynamics 365 (online) with Exchange on-premises, ensure your firewall allows connectivity from the list of IP ranges documented in [Microsoft Dynamics CRM Online IP Address Ranges](https://support.microsoft.com/help/2728473) including the referenced [Azure IP ranges](https://support.microsoft.com/topic/microsoft-dynamics-crm-online-ip-address-ranges-0b22a844-e61d-443b-482f-945de79f764d). |
40 | 37 |
|
41 | | -- **Resolution 3:** The Test Connection results aren't always reliable. If the same username and password works when doing a test connection from [Microsoft Remote Connectivity Analyzer](https://testconnectivity.microsoft.com/tests/o365), 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. |
| 38 | +## Cause 3: Unreliable test connection results |
42 | 39 |
|
43 | | - > [!NOTE] |
44 | | - > 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. |
| 40 | +The test connection results aren't always reliable. If the same username and password works when [testing connection with Microsoft Remote Connectivity Analyzer](/power-platform/admin/test-connection-exchange-server-onpremises#test-connection-with-the-microsoft-remote-connectivity-analyzer), use the **Test & Enable Mailboxes** option in Dynamics 365 instead of the **Test Connection** option. If the **Test & Enable Mailboxes** is successful for your mailboxes, you can disregard the results from the **Test Connection** dialog. |
| 41 | + |
| 42 | +> [!NOTE] |
| 43 | +> If any failures occur using the **Test & Enable Mailboxes** button, see the **Alerts** tab in the mailbox record and review any help links that are included. |
0 commit comments