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.