| title | Configure SQL Server Agent Mail to Use Database Mail | Microsoft Docs | ||
|---|---|---|---|
| ms.custom | |||
| ms.date | 08/05/2016 | ||
| ms.prod | sql-server-2016 | ||
| ms.reviewer | |||
| ms.suite | |||
| ms.technology |
|
||
| ms.tgt_pltfrm | |||
| ms.topic | article | ||
| helpviewer_keywords |
|
||
| ms.assetid | 4b8b61bd-4bd1-43cd-b6e5-c6ed2e101dce | ||
| caps.latest.revision | 31 | ||
| author | JennieHubbard | ||
| ms.author | jhubbard | ||
| manager | jhubbard |
This topic describes how to configure [!INCLUDEssNoVersion] Agent to use Database Mail to send notification and alerts in [!INCLUDEssCurrent] by using [!INCLUDEssManStudioFull]. For information on how to enable and configure Database Mail, see Configure Database Mail. For an example using [!INCLUDEtsql], see Create a Database Mail Profile.
-
Before you begin:
-
To Configure SQL Server Agent to use Database Mail, using SQL Server Management Studio
-
Create a Database Mail account for the [!INCLUDEssNoVersion] Agent service account to use.
-
Create a Database Mail profile for the [!INCLUDEssNoVersion] Agent service account to use and add the user to the DatabaseMailUserRole in the msdb database.
-
Set the profile as the default profile for the msdb database.
The user creating the profiles accounts and executing stored procedures should be a member of the sysadmin fixed server role.
To configure SQL Server Agent to use Database Mail
-
In Object Explorer, expand a [!INCLUDEssNoVersion] instance.
-
Right-click SQL Server Agent, and then click Properties.
-
Click Alert System.
-
Select Enable Mail Profile.
-
In the Mail system list, select Database Mail.
-
In the Mail profile list, select a mail profile for Database Mail.
-
Restart SQL Server Agent.
The following tasks are necessary to complete the configuration of Agent to send alerts and notifications.