Udostępnij za pośrednictwem


Configure SQL Server Agent Mail to Use Database Mail

This topic describes how to configure SQL Server Agent to use Database Mail to send notification and alerts in SQL Server 2012 by using SQL Server Management Studio.

  • Before you begin:

  • Prerequisites

  • Security

  • To Configure SQL Server Agent to use Database Mail, using SQL Server Management Studio

  • Follow-up Tasks

Before You Begin

Prerequisites

  • Enable Database Mail.

  • Create a Database Mail account for the SQL Server Agent service account to use.

  • Create a Database Mail profile for the SQL Server 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.

Security

Permissions

The user creating the profiles accounts and executing stored procedures should be a member of the sysadmin fixed server role.

[Top]

Using SQL Server Management Studio

To configure SQL Server Agent to use Database Mail

  • In Object Explorer, expand a SQL Server 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.

[Top]

Follow-up Tasks

The following tasks are necessary to complete the configuration of Agent to send alerts and notifications.

  • Alerts

    Alerts can be configured to notify an operator of a particular database event or operating system condition.

  • Operators

    Operators are aliases for people or groups that can receive electronic notification

[Top]