Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to:
SQL Server
Use the DatabaseMail XPs option to enable Database Mail on this server. The possible values are:
0
: Database Mail isn't available (default).
1
: Database Mail is available.
The setting takes effect immediately without a server stop and restart.
After enabling Database Mail, you must configure a Database Mail host database to use Database Mail.
Configuring Database Mail using the Database Mail Configuration Wizard enables the Database Mail extended stored procedures in the msdb
database. If you use the Database Mail Configuration Wizard, you do not have to use the sp_configure
example below.
Setting the Database Mail XPs option to 0
prevents Database Mail from starting. If it is running when the option is set to 0
, it continues to run and send mail until it is idle for the time configured in the DatabaseMailExeMinimumLifeTime
option.
The following example enables the Database Mail extended stored procedures.
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Database Mail XPs', 1;
GO
RECONFIGURE
GO
The following example enables the Database Mail extended stored procedures if it is not already enabled.
IF EXISTS (
SELECT 1 FROM sys.configurations
WHERE NAME = 'Database Mail XPs' AND VALUE = 0)
BEGIN
PRINT 'Enabling Database Mail XPs'
EXEC sp_configure 'show advanced options', 1;
RECONFIGURE
EXEC sp_configure 'Database Mail XPs', 1;
RECONFIGURE
END
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayTraining
Module
Configure databases for optimal performance - Training
Configure databases for optimal performance
Documentation
Database Mail
Configure SQL Server Agent mail to use Database Mail - SQL Server
Configure SQL Server Agent mail to use Database Mail
Configure Database Mail - SQL Server
Configure Database Mail using the Database Mail Configuration Wizard or T-SQL commands.