SQL Database mail with Office365 and STARTTLS problem

Krzysztof Cybula 1 Reputation point
2022-04-01T10:24:27.737+00:00

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
    2022-04-01T12:35:38.93+00:00

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

    Please see:
    https://learn.microsoft.com/en-us/microsoft-365/compliance/prepare-tls-1.2-in-office-365?view=o365-worldwide

    0 comments No comments

  2. Krzysztof Cybula 1 Reputation point
    2022-04-01T13:31:56.187+00:00

    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
    2022-04-01T14:48:40.43+00:00

    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
    2022-04-01T15:07:01.953+00:00

    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
    2022-04-04T09:23:42.277+00:00

    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.

    189678-screenshot-2022-04-04-171818.jpg

    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".