Share via

SQL Server Database Mail cannot send email smtp.office365.com

Amit Kakad 0 Reputation points
2025-04-02T14:02:01.84+00:00

SQL Server Database Mail cannot send email smtp.office365.com

Hi, I try to use SQL Server Database Mail, and I get this error:

The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 7 (2025-04-02T16:57:33). Exception Message: Cannot send mails to mail server. (Error in processing. The server response was: 5.7.3 STARTTLS is required to send mail [LO4P265CA0007.GBRP265.PROD.OUTLOOK.COM 2025-04-02T11:27:32.964Z 08DD7161F6BFCBDA]).).

The configuration I use is:

Server: smtp.office365.com

Port Number: 587

Authentication: Basic (An email address and password)

I am able to telnet from the server to smtp.office365.com on port 587.

I can send email within my organization but getting this error only while sending email to outside world.

SQL Server Reporting Services
SQL Server Reporting Services

A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 84,086 Reputation points
    2025-04-02T15:39:49.28+00:00

    Office 365 requires tsl and no longer supports basic authentication. You will need a smtp proxy/relay to use basic authentication

    https://techcommunity.microsoft.com/blog/exchange/exchange-online-to-retire-basic-auth-for-client-submission-smtp-auth/4114750.

    note: sql mail uses smtpclient which is not being updated to support oauth authentication.

    Was this answer helpful?

    0 comments No comments

  2. Michael Taylor 61,221 Reputation points
    2025-04-02T14:10:37.69+00:00

    To talk to MS365 your SQL Server must be using SSL and it must be using TLS 1.2. You didn't mention what version of SQL you're running. Ensure that SQL is configured to use TLS 1.2 as discussed here.

    Also ensure that you have checked the option in the configuration to use SSL.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.