Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

How to enable database mail in msdb database?


Asked by Amoura Gonzalez on Dec 02, 2021 FAQ



To enable the database mail feature, the following prerequisites are required: Service Broker for MSDB database must be enabled. SQL Server Agent service must be running. Database Mail requires service broker to queue emails.
Likewise,
Responding Yes, is equivalent to enabling Database Mail by using the Database Mail XPs option of the sp_configure system stored procedure. Perform all of the tasks required to set up Database Mail for the first time. This option includes all of the other three options.
And, Database Mail is a mail queuing system. The email messages are stored in a queue within the msdb database waiting to be processed. When an email message is placed in the queue, an external process is triggered to send the email messages in the queue to the appropriate mail server.
Additionally,
Database Mail is sent via a profile, rather than a user account directly. To send email with Database Mail you need to create a Database Mail account, a Database Mail profile, add the account to the profile, and then grant a user access to that profile. The user needs to be on the msdb database.
In addition,
The SQL Server Agent is a little slow to learn: it won’t be able to use database mail until you restart the Agent service. Important reminders: Check if any jobs are running before restarting the SQL Server Agent Service.