DB mail or Database mail is a SQL Server Feature, which is used to send email from SQL Server Database Engine.Using database mail in sql server , can send notification to email id’s like alerts, any query output,SQL server health status report,SQL Agent Job notifications and more.
In this post,We will show you how SQL Db mail can be configured using GUI(Graphical User Interface) or how to setup sql mail
To start the DB Mail configuration wizard,Connect to SQL Server with SSMS(SQL Server management Studio) and Expand Management,Select Configure Database Mail, which will open Database Mail configuration wizard.
Note: If already db mail configured,Important scripts to start database mail ,stop database mail,check database mail status
How to Start database mail?
EXECUTE msdb.dbo.sysmail_start_sp;
Stop database mail
EXECUTE msdb.dbo.sysmail_stop_sp;
Database mail status
EXECUTE msdb.dbo.sysmail_help_status_sp;
This window show the welcome wizard for Database Mail Configuration Wizard,Click on Next to start setup database mail sql server.
As a next step, will have 3 options ,As we want to setup DB Mail ,select first option and click on Next
If SQL DB Mail feature is not enabled ,will get below window,To enable database mail on sql server ,Click on Yes to enable the feature.If already installed ,will not get below pop up,Then Click Yes
SQL DB mail feature is enabled and moved to next window of the database mail wizard.
Here need to provide profile name , Description, Giving valid names will help to understand later. Then click on add to assign a SMTP Account.
As no SMTP Account created on this server,Click on Add to create SMTP Account.
To create SMTP Account need to provide details like Account Name,Description,Email Address,Display Name,Reply Email, SMTP Server details,Select Anonymous Authentication for basic authentication method and click on OK
Once we create SMTP Account , showing under SMTP Accounts as below.Click on Next
Now,the below shown windows shows more option to configure DB mail,which can be left default and click on Next
Now the wizard will show the profile names ,which we created,now click on Next
Below window shows the Summary of the DB mail to create Database mail.Now click on Finish
Now the DB mail configuration is completed successfully and Database Mail is ready to use to send email from the SQL Database Engine
With this post,I explained step by step with screenshots on how to configure DB Mail in SQL Server.