We have had a recurring problem since about October, where our emails through our SQL 2016 database will intermittently fail throwing this error through SQL Server Mail:

Message The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 3. Exception Message: Cannot send mails to mail server. (Failure sending mail.).

Again, some emails are successfully delivered on the first try, others are delivered on the 2nd try, and some fail to be delivered on both attempts.

We are using smtp.office365.com port 587 with basic authentication, SSL checked.

TLS 1.2 is enabled and showing correctly in email headers, but I am unable to see the cause as to why some emails are failing to go out, while others are successful.

I see no packet loss to the office smtp IP during one of these failures either. The server itself is updated to the most recent .NET framework as well.

Apologies if this information is inadequate, I am not too familiar with this whole concept and trying to learn as I go.

  • "no packet loss to the office smtp IP" -- surely if no packets are sent there is no loss. You should validate if you can resolve the server name and connect to the SMTP port (when the error occurs obviously).
    – mustaccio
    Jan 3, 2022 at 19:57
  • I am able to successfully resolve the name as well as connect to the port during the error as well.
    – Anon 321
    Jan 3, 2022 at 20:22
  • Ensure TLS 1.2 is correctly setup and enabled on the SQL Server itself. The intermittency is a smell for that possibly being the issue. Unfortunately that issue is a somewhat complex one to debug and resolve (I ran into the same but eventually stumbled my way to a fix). Please see all of the answers on this DBA.StackExchange post. I believe I had to follow the top voted answer in addition to other changes I unfortunately am currently blanking on.
    – J.D.
    Jan 3, 2022 at 22:53
  • Welcome to the DBA.SE community. Is there any chance you could be a bit more specific about your mail configuration? You are using SQL Server Mail, right? Hit the edit link and add as much details as possible. Currently your question doesn't contain enough details and might be closed due to the mentioned reason.
    – John K. N.
    Jan 4, 2022 at 9:17

1 Answer 1


Basic authentication will reach end-of-life later this year, so you will have to modify your configuration to use a different method to send email anyway.

Today, we are announcing that, effective October 1, 2022, we will begin to permanently disable Basic Auth in all tenants, regardless of usage, with the exception of SMTP Auth.

The blog post also makes it clear that there have been intermittent issues:

IMPORTANT: Beginning early 2022, we will selectively pick tenants and disable Basic Auth for all affected protocols except SMTP AUTH for a period of 12-48 hours. After this time, Basic Auth for these protocols will be re-enabled, if the tenant admin has not already re-enabled them using our self-service tools.

So without having more information, I'm going to vote to close this issue, and recommend you transition off basic authentication as soon as possible.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.