Showing posts with label server does not support secure connections smtp exception. Show all posts
Showing posts with label server does not support secure connections smtp exception. Show all posts

Saturday 18 June 2016

SMTP Server: System.Net.Mail.SmtpException: Server does not support secure connections (Office365 SMTP).

Or, Office365 SMTP Error:
--------------------------------------------------------------------------------------------------------------------------
SMTP Server Settings => SMTP Server: smtp.office365.com, Port: 587, EnableSsl: True, UserName: emailIDTest@youremaildomain.com, Password: *******
Error occured while sending mail using 'smtp.office365.com' SMTP Server: System.Net.Mail.SmtpException: Server does not support secure connections.
 at System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint)
 at System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint)
 at System.Net.Mail.SmtpClient.GetConnection()
 at System.Net.Mail.SmtpClient.Send(MailMessage message)
 at QuantMailService.MailService.SendMailMessage(MailMessage mailMessage, Boolean isSSLEnabled)
-----------------------------------------------------------------------------------------------------------


Problem:  Applications using Office365 SMTP for sending mails, stops working suddenly and works well after restarting the mailing services.

Scenario Description:  For the above error scenario, I had struggled a lot with programming team, Microsoft Support and with many more blogs and articles. Thanks to Microsoft Escalation Support guys who shows me the more relevant cause of this problem.

My point is, If the SSL is not supported on the server as per the error occurred, why the mail flow starts working after resting the service? SSL not supported platform should not be fixed only after restarting the services or server, it must have some settings to get it supported or change the method of mail flow which is supported my Office365 SMTP server. When we restart the services, mail flow works well but we don’t know when this will be stopped with some SMTP error.


Possible Solutions:
1. First thing first, if you are using EnableSSL:True argument in your mail sending application code, you may try to Change it to EnableSSL:False, this may solve your problem but please make sure you have verified your mail flow scenario and compatibility. If not sure about this, please seek help from Microsoft Support.
2. Schedule an automated reboot of the mailing service on daily basis using windows task scheduler with the help of some task scheduling scripts. This will help to keep your mailing service healthy and mails flow may not stops frequently
3. Last and the most important thing, Office 365 do not support SSL since 1st Dec, 2014, It supports TLS with following TLS versions:
•TLS version 1.2 (TLS 1.2)
•TLS version 1.1 (TLS 1.1)
•TLS version 1.0 (TLS 1.0)
So, now you can think of making changes in your mail sending code of application to make sure you are using not using SSL anymore. Start using TLS instead.

You may refer below URL for more info on this:

Good Luck, please write me back if you have any feedback or query on this.