|
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 | | -ms.topic: troubleshooting |
6 | | -ms.date: 11/19/2024 |
| 5 | +ms.date: 12/11/2024 |
7 | 6 | ms.custom: sap:Email and Exchange Synchronization |
8 | 7 | --- |
9 | | -# Test Connection fails from Email Server Profile in Microsoft Dynamics 365 |
| 8 | +# Test Connection fails with 401 or time-out error in email server profile in Microsoft Dynamics 365 |
10 | 9 |
|
11 | | -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. |
12 | 11 |
|
13 | 12 | _Applies to:_ Microsoft Dynamics 365 |
14 | 13 | _Original KB number:_ 4493267 |
15 | 14 |
|
16 | 15 | ## Symptoms |
17 | 16 |
|
18 | | -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 [test connection on an email server profile record](/power-platform/admin/connect-exchange-server-on-premises#create-an-email-server-profile) in Dynamics 365, the test fails and you might see one of the following errors: |
19 | 18 |
|
20 | | -> "Remote server error: (401) Unauthorized. Make sure the user name and password you entered are correct and try again." |
21 | | -or |
| 19 | +> Remote server error: (401) Unauthorized. Make sure the user name and password you entered are correct and try again. |
22 | 20 |
|
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)" |
| 21 | +Or |
26 | 22 |
|
27 | | -## 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) |
28 | 26 |
|
29 | | -- **Cause 1:** The username or password isn't correct. |
| 27 | +## Cause 1: Incorrect username or password |
30 | 28 |
|
31 | | -- **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. |
| 29 | +To solve this issue, verify the username and password are correct. |
32 | 30 |
|
33 | | -- **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. |
| 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`. |
34 | 33 |
|
35 | | -## Resolution |
| 34 | +## Cause 2: Firewall blocking connectivity |
36 | 35 |
|
37 | | -- **Resolution 1:** Verify the username and password are correct. |
| 36 | +If you use Dynamics 365 (online) with Exchange on-premises, ensure your firewall allows connectivity from the list of IP ranges documented in [Power Platform URLs and IP address ranges](/power-platform/admin/online-requirements#ip-addresses-and-urls) including the referenced [Azure IP ranges](/power-platform/admin/online-requirements#ip-addresses-required). |
38 | 37 |
|
39 | | - > [!NOTE] |
40 | | - > The User Name value needs to be in UPN (User Principal Name) format. Ex. `[email protected]` instead of `contoso\username`. |
| 38 | +## Cause 3: Unreliable test connection results |
41 | 39 |
|
42 | | -- **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). |
| 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](/power-platform/admin/connect-exchange-online#test-the-configuration-of-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. |
43 | 41 |
|
44 | | -- **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. |
| 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. |
45 | 44 |
|
46 | | - > [!NOTE] |
47 | | - > 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. |
| 45 | +## More information |
| 46 | + |
| 47 | +- [Connect to Exchange Server (on-premises)](/power-platform/admin/connect-exchange-server-on-premises) |
| 48 | +- [Test connection to Exchange Server (on-premises)](/power-platform/admin/test-connection-exchange-server-onpremises) |
| 49 | +- [Connect Customer Engagement (on-premises) to Exchange Online](/dynamics365/customerengagement/on-premises/admin/connect-dynamics-365-on-premises-exchange-online) |
0 commit comments