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,715 questions
{count} votes

6 answers

Sort by: Newest
  1. Francesco Mantovani 1 Reputation point
    2022-05-03T08:36:46.983+00:00

    Yes, @Mor Levi , I wrote a post about it and you can read it here.

    Let me know if this helps.

    0 comments No comments

  2. 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?


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

  4. 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?


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