STARTTLS is required when trying to send an email within SQL Server

Jason Yeung 61 Reputation points
2021-03-19T00:42:37.92+00:00

Hi,
I'm trying to setup a couple of alerts on SQL Server which sends me a message when the alert executes. I've setup an account in Database Mail, which sends an email via "smtp.office365.com", using port 587. Below is the settings I used (I removed the domain of the accounts for security purposes):
79393-bssi-jira-settings-database-mail.jpg

When I to send a test message, I get the following errors, depending on whether I have the "This server requires a secure connection" checkbox checked.

If this checkbox is not checked, I get:
Exception message: cannot send mails to mail. The server response was 5.7.3 STARTTLS is required to send mail

If this checkbox is checked, I get:
The server response was 5.7.57 Client not authenticated to send mail.

I also tried port 25, basic and anonymous authentication and a variety of users when using basic authentication, but the same errors appear. I was wondering how do I set the account up so I could send a message from SQL Server?

Sincerely,

Jason

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

6 answers

Sort by: Most helpful
  1. AmeliaGu-MSFT 13,961 Reputation points Microsoft Vendor
    2021-03-19T06:15:11.253+00:00

    Hi JasonYeung-2529,
    What the version of SQL Server and OS are you using?
    Please refer to this doc to check if TLS 1.2 is supported for your OS and SQL Server, and make sure the TLS 1.2 is enabled.
    And here is a tool which may help you to manage protocols.

    Best Regards,
    Amelia


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread


  2. Francesco Mantovani 1 Reputation point
    2021-06-10T08:48:05.093+00:00

    nartac didn't worked.
    It's particularly bad because I'm using Windows Authentication

    104109-swordmail.png


  3. Tooth Fairy's Tale 1 Reputation point
    2021-09-15T12:53:45.997+00:00

    Thank you TomPhillips-1744 for replying!! when I click the box, then it says, "The token supplied to the function is invalid" ?? (this is the program I am trying to send emails from called IBP) Is there another place I need to check that box?


  4. Tooth Fairy's Tale 1 Reputation point
    2021-09-15T13:00:09.357+00:00

    Should incoming mail be set at: SSL/TLS and outgoing set as: STARTTLS? However, in the outlook account settings, I'm not seeing a box to check for SSL?

    0 comments No comments

  5. Tooth Fairy's Tale 1 Reputation point
    2021-09-15T13:03:54.45+00:00

    If the above is correct, it is set at that... so I wonder what I am missing or doing wrong?