Tuesday, May 4, 2010

Configure SQL Server Agent Mail to Use Database Mail

I had an issue this morning when email notifications were not working for a SQL Server Agent Job. I found this entry in the error logs:
[264] An attempt was made to send an email when no email session has been established
A quick Google search led me to this article:
To set up SQL Server Agent Mail to use Database Mail
  1. In Object Explorer, expand a server.

  2. Right-click SQL Server Agent, and then click Properties.

  3. Click Alert System.

  4. Select Enable Mail Profile.

  5. In the Mail system list, select Database Mail.

  6. In the Mail profile list, select a mail profile for Database Mail.

  7. Restart SQL Server Agent.

Following these steps and configuring the mail profile accordingly allowed me to be able to successfully send the email notifications.