Reputation: 41
We have a job in SSMS which runs daily and goes through steps that send out emails to employees with different reports. Recently, one of the queries stopped sending out emails and I'm not sure why.. I wasn't the one who made this query and I'm not an expert in SQL. One of the first things I tried was seeing if I could run it but take out the 4-5 recipients and only have one in there. To my surprise, it went through right away. I'm trying to figure out how come it might be slipping up when there's more than one recipient. Any ideas?
The query was working before, so I'm not sure how helpful it is to post.
Here's the dbmail section:
SET @BOD = '<HTML>
<HEAD>
<H1>Company Name</H1>
<H2>Work Order Requirements</H2>
</HEAD>
<BODY>
' + @BOD
SET @BOD = @BOD + '</table>'
SET @BOD = @BOD + '</BODY></HTML>'
EXEC msdb.dbo.sp_send_dbmail
@recipients = '[email protected]; [email protected]; [email protected]; [email protected];',
@profile_name = 'DBA_Notifications',
@subject = @SUB,
@body = @BOD,
@body_format = 'HTML'
Upvotes: 0
Views: 978