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)"