Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Sending email from store proc

$
0
0
I have a store proc that generates a list of individuals who need to get an email along with the subject and body of the email that each person should get. How do I step through the list from the stored proc and send an email to each person in the list.This is the stored proc that creates the list who are to get an email... SELECT e.Email, 'Deliverable Due' AS Subject, 'You have a deliverable due on - ' + d.DueDate + '. It is ' + d.Deliverable AS Body FROM dbo.tblEmployeesResponsible INNER JOIN CommonData.dbo.tblEmployee AS e ON dbo.tblEmployeesResponsible.EmpID = e.EmpID INNER JOIN dbo.tblDeliverables AS d ON dbo.tblEmployeesResponsible.DelCatID = d.DelCatID WHERE (dbo.ufn_DateValue(d.DueDate) = dbo.ufn_DateValue(GETDATE() - 7))

Viewing all articles
Browse latest Browse all 3145

Trending Articles