We're using SQL Server 2005. Every so often our mail server goes down, and when this happens, as soon as our SQL code tries to send dbmail, the Database Mail Log has an item which looks like this:

Date        12/9/2013 07:38:05
Log     Database Mail (Database Mail Log)

Log ID      327487
Process ID      5680
Mail Item ID        442779
Last Modified       12/9/2013 07:38:05
Last Modified By        sa

The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 2 (2013-12-09T07:38:05). Exception Message: Could not connect to mail server. (No such host is known).

The problem is that our admin accounts are notified by email with the database mail error, which creates an obvious problem: since the mail server is down, the "Database Mail error" email notification creates another mail log entry because that email couldn't be delivered, which triggers another email notification. An infinite loop is created, which results in 20-30 log entries generated every second, and when the email server finally does come online, all of these are delivered to our admins email inboxes.

My question is: Where do we configure who gets notified and how when a database mail error occurs? How do we disable email notification by Database Mail when a dbmail error occurs?

I've looked through Database Mail and SQL Server Agent and can't find anything. There are two operators defined in SQL Server Agent, but the history tab of the operators doesn't indicate that they have been emailed. There are no Alerts or Jobs that are set up that email the operators either. Does Database Mail simply email all operators if an error occurs?

Thanks for you help!

  • Is fail-safe operator configured under the Alert System settings of SQL Agent? Only allows selection of a single configured operator, is one of those operators a distribution list? – user507 Jun 2 '14 at 10:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.