0

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

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
biks
  • 25
  • 1
  • 2
  • Please don't tag spam, none of these tags are related the the question you are asking here. I;ve corrected what I can, but you also should tag the Mail Server software you are using. – Thom A Mar 30 '21 at 10:17
  • There is no SQL Server 2018 version - we have 2012, 2014, 2016, 2017 and 2019 - take your pick – marc_s Mar 30 '21 at 10:18
  • As for the error, it's telling you that, for what ever reason, the SQL Server instance/host can't communicate with the Mail Server; we don't have enough information to tell you more than that. – Thom A Mar 30 '21 at 10:18

1 Answers1

0

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.

MC9000
  • 2,076
  • 7
  • 45
  • 80