SQL Server – Send Email Using Database Mail From TSQL or Stored Procedure

Pretty simple stuff. This assumes that a valid database account etc. is set up and Database Mail is configured correctly

[code:tsql]

EXECUTE msdb.dbo.sp_send_dbmail @recipients=’to@xxx.com’,
@subject = ‘Test email’,
@body = ‘Test email body’,
@reply_to=’from@yyy.com’

[/code]

Leave a Reply

Your email address will not be published. Required fields are marked *