Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29755

How do I compile SQL email but not send?

$
0
0

In SQL Server, it's possible to send an email via Outlook.

I want to compile an email but have it automatically sent. The code below automatically queues the email and sends to the recipients. I need to make adjustments on the email before sending it out. These adjustments account for dates. Is that possible?

EXEC msdb.dbo.sp_send_dbmail  
@profile_name = 'Email Team',
@recipients='username@eemail.com',
@subject='Monthly Report',
@body='Good morning, reports have ran for these dates: ',
@body_format='HTML',
@from_address='<username@email.com>'

As a result, I get this:

Mail (Id: 3549) queued.

Viewing all articles
Browse latest Browse all 29755

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>