HiveBrain v1.2.0
Get Started
← Back to all entries
snippetsqlMinor

How to send email from SQL Jobs in SQL Server 2014

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
emailsqljobshowserverfromsend2014

Problem

How to send email from SQL Server Jobs in SQL Server 2014. I want to implement email notification through stored procedure instead of Windows services.

Solution

You need to first configure DB mail in SQL Server in order to utilise this functionality. You can use the below link as a reference for DB mail configuration purposes.

https://www.brentozar.com/blitz/database-mail-configuration/

Once DB mail is set up, you can enable database mail on SQL Server Agent. The same link describes how to do that. Once it is enabled on SQL Server Agent, you need to restart the SQL Server Agent service to make that take effect.

That's it. Now you can use the msdb.dbo.sp_send_dbmail SP to send email using a SQL Server Agent job or a stored procedure.

Context

StackExchange Database Administrators Q#142915, answer score: 6

Revisions (0)

No revisions yet.