Dynamics – Troubleshooting Server Side Sync exceptions
Server-side synchronization is used to synchronize your email system with Dynamics 365 for Customer Engagement apps at the server level.
Now coming to the issue, I was configuring Server side sync on my CRM on-premise instance with ‘Gmail’ as host and got the below error while testing the mail delivery of a ‘Mailbox’ using ‘Test & Enable Mailbox’ option.
Reason:
- In my case, its CRM on-premise installation and were having below 3 servers
- Front End Server – Contain CRM WebApp
- Application Server – Contain Services (Async, Sandbox, etc..)
- Back End Server – Contain SQL Server and SSRS
- Issue was ‘Incoming Port’ and ‘Outgoing Port’ were not opened on my ‘Application server’ which caused the issue
Now lets see few sanity steps and how to troubleshoot issues.
[Sanity Step] Make sure Ports and Mailbox settings are correct:
- Test the settings provided in ‘Email Server Profile’ using console application
- Create a simple C# console application with below code and pass the settings (i.e., Port, host names etc) mentioned in ‘Email Server Profile’
using (MailMessage mail = new MailMessage()){
int portNumber = Convert.ToInt32(ConfigurationManager.AppSettings[“port”].ToString());
var smtpAddress = ConfigurationManager.AppSettings[“smtpAddress”].ToString();
var emailFromAddress = ConfigurationManager.AppSettings[“emailFromAddress”].ToString();
var password = ConfigurationManager.AppSettings[“password”].ToString();
var emailToAddress = ConfigurationManager.AppSettings[“emailToAddress”].ToString();mail.From = new MailAddress(emailFromAddress);
mail.To.Add(emailToAddress);
mail.Subject = “Set mail subject”;
mail.Body = “Set mail body”;
mail.IsBodyHtml = true;
using (SmtpClient smtp = new SmtpClient(smtpAddress, portNumber)){
smtp.Credentials = new NetworkCredential(emailFromAddress, password);
smtp.EnableSsl = enableSSL;
Console.WriteLine(“Sending mail…”);
smtp.Send(mail);
Console.WriteLine(“Mail has been sent…”);
}
}
App Settings:
<appSettings>
<add key=”port” value=”587″/>
<add key=”smtpAddress” value=”smtp.gmail.com”/>
<add key=”emailFromAddress” value=”rajeevpentyala@gmail.com”/>
<add key=”password” value=”*******”/>
<add key=”emailToAddress” value=”rajeevpentyala@live.com”/>
</appSettings>
[Sanity Step] Make sure your Incoming and Outgoing server locations are reachable:
- From command prompt, ping the locations with below command and make sure you are getting response
- Ping -t {location} (Ex- Ping -t smtp.gmail.com)
[Issue] If failed with “The SMTP server requires a secure connection” exception
- Connect to your Gmail account. Link
- Turn on the “Less secure app access” option

Turn on ‘Less secure app access’
- You may also get “Smtp server returned OutgoingServerSecureChannelError MustIssueStartTlsFirst exception.“ message and the fix is same.
[Issue] Client was not authenticated. The server response was: 5.5.1 Authentication Required
- You might get this issue, If the password of your Email Id requires a reset. Change your password and try by providing new password in Mail Box.
Refer this article for more exhaustive list of troubleshooting options
🙂