question

JasonYeung-2529 avatar image
0 Votes"
JasonYeung-2529 asked FrancescoMantovani-8046 answered

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

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-general
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Have the same error! in my 365mail marked autenticated SMTP...

and in my logged - "General Error System.Net.Mail.SmtpException: Error in processing. The server response was: 5.7.3 STARTTLS is required to send mail [**.eurprd02.prod.outlook.com]
at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, MailAddress from, Boolean allowUnicode)
at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception)
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at NotificationLib.SmtpMailSender.Send(Dictionary`2 config)"

Do you have eny solution ? getting crazy because of that
Thank you!

0 Votes 0 ·
AmeliaGu-msft avatar image
0 Votes"
AmeliaGu-msft answered ToothFairysTale-1298 edited

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


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I am having a problem with sending my email from a certain program. Even though it is set up using STARTTLS, I am getting an error message saying 451 5.7.3 STARTTLS is required to send mail [BYAPR11CA0103.namprd11.prod.outlook.com] I am so frustrated with this! Can someone PLEASE help me!! Thank you!!

0 Votes 0 ·
FrancescoMantovani-8046 avatar image
0 Votes"
FrancescoMantovani-8046 answered TomPhillips-1744 commented

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

104109-swordmail.png



swordmail.png (33.0 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The box "This Server requires a secure connection (SSL)" must be checked.

0 Votes 0 ·
ToothFairysTale-1298 avatar image
0 Votes"
ToothFairysTale-1298 answered TomPhillips-1744 commented

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?

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ToothFairysTale-1298 avatar image
0 Votes"
ToothFairysTale-1298 answered

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?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ToothFairysTale-1298 avatar image
0 Votes"
ToothFairysTale-1298 answered FrancescoMantovani-8046 commented

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

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Oh wow, so you created this yourself? And it's free? I wish I understood computers more and how to install it, I am so new at all this... but I am going to keep this and see if I can attempt it one day. I'm just afraid I will mess something up in my computer that i won't be able to fix... sigh! But thanks for this, it is greatly appreciated! :))

0 Votes 0 ·

Don't be afraid. Edit the first few lines, paste it in a SSMS tab and press F5.
The query will install the account for you.
If it doesn't work or if it brakes stuff.... this is how we all learnt.

0 Votes 0 ·
FrancescoMantovani-8046 avatar image
0 Votes"
FrancescoMantovani-8046 answered

Yes, @MorLevi-1850 , I wrote a post about it and you can read it here.

Let me know if this helps.



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.