"The email server location or the incoming email port specified in the associated email server profile [profile name] is incorrect" error occurs in Microsoft Dynamics 365

This article provides a solution to an error that occurs when you attempt to test and enable a mailbox in Microsoft Dynamics 365.

Applies to:   Microsoft Dynamics 365
Original KB number:   4463808

Symptoms

When you attempt to test and enable a mailbox in Microsoft Dynamics 365, you receive the following error:

"Email cannot not be received for the mailbox [mailbox name] because the email server location or the incoming email port specified in the associated email server profile [profile name] is incorrect. The mailbox didn't synchronize. The owner of the email server profile has been notified.

Email Server Error Code: Socket returned exception InvalidIncomingEmailServerProfileConfiguration HostNotFound."

If you select details, you see the following extra details:

"ActivityId: <GUID>
>Error : System.Net.Sockets.SocketException (0x80004005): No such host is known
at System.Net.Dns.GetAddrInfo(String name)
at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
at System.Net.Sockets.TcpClient.Connect(String hostname, Int32 port)
at Microsoft.Crm.Asynchronous.EmailConnector.Pop3Client.Connect()"

Cause

This error can occur if the server location or port in the email server profile aren't correct.

Resolution

  1. Navigate to Settings, Email Configuration, and then select Email Server Profiles.

  2. Open the Email Server Profile that is used by the mailbox meeting this error.

    Note

    You can also select the name of the Email Server Profile within the error message. It appears as a hyperlink which will open the correct Email Server Profile record.

  3. Verify the Incoming Server Location value.

    Note

    Refer to the documentation from your email provider for the correct addresses. For Gmail, the incoming server location would be pop.gmail.com and the outgoing server location would be smtp.gmail.com.

  4. Select Advanced.

  5. Verify the Incoming Port value and then select Save.

    Note

    Refer to the documentation from your email provider for the correct ports to use when connecting to the SMTP service. For Gmail, the incoming POP3 port is 995 and outgoing SMTP port is 587.

  6. Select Mailboxes and then select the mailbox that received the error.

  7. Select the Test & Enable Mailboxes button.

  8. After the tests complete, open the mailbox record and view the Alerts section if the results don't appear as Success.

Third-party information disclaimer

The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, about the performance or reliability of these products.