SQL Database mail with Office365 and STARTTLS problem

Krzysztof Cybula 1 Reputation point

Hi everybody,
I have SQL Server with Database mail sending emails by Office 365 administered by client.
SQL is configured to use SSL, smtp.office365.com and port 587, account name and correct password.
It was working perfect, but few days ago sending stopped. I investigate that now smtp.office365.com needs STARTTLS command do relay mails.
What have to be done on Office365 connecor or what you suggest to chage on SQL Server database mail to allow use Office365?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
11,635 questions
0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. Tom Phillips 17,691 Reputation points

    Most likely this is due to the new TLS 1.2 requirement in office365.com being turned on for your account.

    Please see:

    0 comments No comments

  2. Krzysztof Cybula 1 Reputation point

    I think it's not a TLS 1.2 problem (I can send mails using email application with STARTTLS options from this server, but it not works with TLS, as in SQL is possible to configure - ony one allowed option). I tried using email application with test server with TLS 1.2 as only possible protocol- the same results. I suppose, settings on Office365 was changed, but I can't confirm that and I'm not familiar with Office365 administration.

    0 comments No comments

  3. Bjoern Peters 8,731 Reputation points

    What version of SQL Server are you using?
    There are issues with supporting TLS 1.2 when using eg SQL Server 2016 (based on the .NET build runtime version)

    0 comments No comments

  4. Krzysztof Cybula 1 Reputation point

    SQL 2017, but it appears with email clients like ThunderBird: STARTTLS works, TLS not (the same settings as Database mail).

  5. CathyJi-MSFT 21,066 Reputation points Microsoft Vendor

    Hi @Krzysztof Cybula ,

    Did you check the "This server requires a secure connection (SSL)" option during configure DB mail? This must be ticked to enable the STARTTLS command that establishes a secure communications channel over which SMTP Basic authentication gets sent. Please check the detail suggestion information from this old thread.


    Please also check if below blog could help you.

    SQL Server Database Mail Failure Troubleshooting & Two Common Issues

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".