SQL Server Mail not reliable - sql-server

We have a SQL Server 2016 Standard Edition. I set up the SQL mail service (account + profile) on it a year ago, which worked perfectly (account: smtp.office365.com:587, SSL, basic auth).
Since October 11, 2021, there have been constant problems with sending mail. In many cases, sending mail doesn't work, I get the following error message:
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 3 (2021-10-27T18: 07: 10). Exception Message: Cannot send mails to mail server. (Failure sending mail.).)
Here is an excerpt from the sysmail_allitems table:
I don't understand what the problem is because the server sends the email once but not the other time.
Do you have any idea what might be causing the problem?

Related

SQL Server 2016 O365 SMTP "Failure sending mail" intermittently?

We have had a recurring problem since about October, where our emails through our SQL 2016 database will intermittently fail throwing this error:
Message The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 3. Exception Message: Cannot send mails to mail server. (Failure sending mail.).
Again, some emails are successfully delivered on the first try, others are delivered on the 2nd try, and some fail to be delivered on both attempts.
We are using smtp.office365.com port 587 with basic authentication, SSL checked.
TLS 1.2 is enabled and showing correctly in email headers, but I am unable to see the cause as to why some emails are failing to go out, while others are successful.
I see no packet loss to the office smtp IP during one of these failures either. The server itself is updated to the most recent .NET framework as well.
Apologies if this information is inadequate, I am not too familiar with this whole concept and trying to learn as I go.

SQL Server Database Mail: The mail could not be sent to the recipients because of the mail server failure

I'm using SQL Server 2012 Developer edition to test Database Mail functionality. But I'm receiving the below error.
The steps I followed:
Installed e-mail certificate to Trusted root certification authorities.
Tested the e-mail functionality using sa user
Account 1 is using port 587 with SSL.
Account 2 is using port 465 with SSL.
Account 3 is using port 25 without SSL.
All accounts are with Basic authentication ( the user name and password is cross verified).
The mail could not be sent to the recipients because of the mail server failure.
(Sending Mail using Account 1 (2021-09-01T15:45:56). Exception Message: Cannot send mails to mail server. (The remote certificate is invalid according to the validation procedure.).
Sending Mail using Account 2 (2021-09-01T15:47:36). Exception Message: Cannot send mails to mail server. (The operation has timed out.).
Sending Mail using Account 3 (2021-09-01T15:47:57). Exception Message: Cannot send mails to mail server. (Service not available, closing transmission channel. The server response was: Cannot connect to SMTP server xxx.xx.xx.xx (xxx.xx.xx.xx:25), connect error 10060).

SQL Server 2018 : database email - exception message: Cannot send mails to mail server. (The operation has timed out

I am using SQL Server Management Studio V18. I would like to schedule a job in SQL agent, which will send some mail based on some condition. For that I have configured database account profile and I am trying to test the email. But email is not received. It is saying the below error. any help on this will appreciate.
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1002 (2021-03-30T05:36:55).
Exception Message: Cannot send mails to mail server (The operation has timed out
My suggestion is to either connect "in the clear" or use a custom or 3rd party program. This (maddening) issue has been with SQL Server for over a decade and, for us, it was because of using a secure connection (time outs - some mail never sent - yada yada). Our email server gets the connection credentials, so it IS communicating with it - (handshaking), but there's a bug with SSL when it comes time to deliver the message.
Our solution was to create a CLR C# program that gets called and delivers messages correctly. You can look for a 3rd party emailer as well. SQL email will always disappoint.

SQL Server 2012 mail server operation timeout issue

I am trying to send approximately 300 mails from the SQL Server 2012 but when I check msdb.dbo.sysmail_mailitems it shows only few mails are sent; others failed with this message:
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 3 (2017-06-06T10:59:27). Exception Message: Cannot send mails to mail server. (The operation has timed out.)
What is the default timeout for SQL Server?

SQL Server DB mail Server Failure

I have a SMTP server by using which I was smoothly sending e-mails using sp db_mail.But now I am not able to send any DB mail using the same profile, all the configuration from SQL Server is fine, but instead getting the following message in Error log
Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 2 (2016-04-21T04:09:58). Exception Message: Cannot send mails to mail server. (Failure sending mail.).
)
P.S. By using the same SMTP server, I am able to send Mails from another IP.
The telnet thing is getting aborted when I tried it from the command line.
Any ideas?

Resources