Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: NOTE: Failed to notify 'operator' via email. when trying to send e-mail when job fails

Tags:

I have a problem with sending notification when the job fails. I created Database Mail Profile and assigned it to SQL Agent and the restarted SQL Agent. When I run a procedure msdb.dbo.sp_send_dbmail the e-mail is being sent. Also when I send a test e-mail using Database Mail it works fine. But when I set a notification for Job when it fails, in job log I see following information: NOTE: Failed to notify 'SQL Job Failure' via email. I don't know what can be the source of this problem. I found this hint: http://sqlblog.jfperry.com/jpsql/post/2009/04/07/NOTE-Failed-to-notify-7boperator7d-via-email.aspx

But I checked that the profile is enabled in SQL Agent. SQL Agent has been restarted. Where can be the source of the problem?

like image 966
Konrad Z. Avatar asked Apr 05 '13 15:04

Konrad Z.


People also ask

How can change SQL Server profile name?

On the Manage Profiles and Accounts page, select Create a new profile option, and click Next. On the New Profile page, specify the Profile name, Description and add accounts to be included in the profile, and click Next.


2 Answers

As you allude to in your question, my issue was indeed the mail profile in agent - thanks for the tip.

enter image description here

Other tips that are mentioned at the bottom of this post include:

  1. Ensure DB mail is enabled within the SQL Server Surface Area Configuration. Do this by right clicking the server name and selecting FACETS from the menu Select the 'Server Configuration' from Facet dropdown Ensure Facet Property of 'DatabaseMailEnabled' is True

  2. Set up a Mail Profile within the Management Folder of your server

  3. Within SQL Server Agent set up an Operator

  4. Look in the properties of the SQL Server Agent (right-click properties) and under the Alert System page tick 'Enable mail profile' and select your default profile that you set up in step 2.

  5. Restart the SQL Server Agent

like image 155
PeterX Avatar answered Oct 14 '22 21:10

PeterX


Second restart of SQL Agent fixed the problem.

like image 38
Konrad Z. Avatar answered Oct 14 '22 21:10

Konrad Z.