"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
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:
>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)
This error can occur if the server location or port in the email server profile aren't correct.
Navigate to Settings, Email Configuration, and then select Email Server Profiles.
Open the Email Server Profile that is used by the mailbox meeting this error.
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.
Verify the Incoming Server Location value.
Refer to the documentation from your email provider for the correct addresses. For Gmail, the incoming server location would be
pop.gmail.comand the outgoing server location would be
Verify the Incoming Port value and then select Save.
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.
Select Mailboxes and then select the mailbox that received the error.
Select the Test & Enable Mailboxes button.
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.