0

I have a job created to do a backup of all my dbs with a schedule time and I have set to this job a notification by mail to my email when the job completes, but I am not receiving any. So I will post here what I have done to set this notitication to see if there is something missing.

In "Database Mail", I have set an email for this notification, with all the info necessary to do SMTP AUTH in my smart host. To test this connection I have used "Send Test E-Mail..." for my email, and it was received without problem. Then, created a new Operator, just with my email and set a name for the Operator. After this I went in this job properties at Jobs in SQL Server Agent, and set at Notifications, E-mail for my new Operator and select to be notified "When the job completes". But still I have not received any notifications after this.

Am I missing any step here?

Thanks!

marafado88
  • 412
  • 2
  • 9
  • 31

2 Answers2

2

The missing step was that I should have activated alerts for the SQL Server Agent.

To be able to do this I went in SQL Server Agent Properties, then Alert System tab, and activate Enable mail profile, for the target Mail profile that I have created before.

Now I am finally receiving alerts in mail email.

I hope this could help others who may have the same problem.

marafado88
  • 412
  • 2
  • 9
  • 31
1

As a test, try executing this code (changing the variables for your environment) and see if you receive the email.

USE msdb
GO
EXEC sp_send_dbmail 
@profile_name='XXXX',
@recipients='xxxx@yourcompany.com',
@subject='Full Backup Completion Message',
@body='The database on the instance was successfully backed up - (full  backup completed).'
go
rvsc48
  • 431
  • 2
  • 7