In this article, I’m explaining how to setup database mail in sql server.
Database mail is used to send the email using SQL Server. it is replacement of SQLMail of SQL Server earlier version. Database Mail has many enhancement over SQLMail. Database Mail is based on SMTP (Simple Mail Transfer Protocol) and also very fast and reliable where as SQLMail is based on MAPI (Messaging Application Programming Interface). Database mail depends on Service Broker so this service must be enabled for Database Mail. Database Mail can be encrypted for additional security
Setup Database Mail
You can find the database mail in sql server under the management like this:
Right click on database mail and select configure database mail.
To Send a mail from Database Mail
If you want to send mail from the code:
use msdb
go
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'TestingDatabaseMail',
@recipients = 'praveshsinghfaq@gmail.com',
@subject = 'Test Mail',
@body = 'Testing E-Mail';
Leave Comment