Friday, December 25, 2020

Send Email using SQL Server


--print 'Rajeev.Kumar@MolinaHealthCare.Com' + ';'+  @sndemail + ','

 

set @subj = 'Auto: ' + @processname + ' - Budget Routine Done'

 

SET @tableHTML=

    N'<html><body>'+ 'Hi, ' + '<br>' +

       N'<br>'+

       N'' +  @processname +   ' completed successfully.<br></H4>' +

   N'<H3>Thank You<br>'+

       N'<br></H3></body></html>'

 

exec msdb.dbo.sp_send_cdosysmail

@From = N'Rajeev.Kumar@xxxxxx.Com',

@To = @sndemail,

@cc=N'Rajeev.Kumar@xxxx.Com',

@ReplyTo = N'Rajeev.Kumar@xxxx.Com',

@Subject = @subj,

@Body = @tableHTML,

@BodyType ='HTMLBODY'


No comments: