You are here:Home » tsql » Send DB Mail with attachement

Send DB Mail with attachement

-----------

Send mail with attachement

-----------

EXEC msdb.dbo.sp_send_dbmail
@recipients=N'test@test.com',
@body= 'mail test with attachement',
@subject ='mail test with attachement',
@file_attachments = 'c:\test.txt',
@profile_name = 'ProfileName'


SELECT sent_status ,recipients,subject,body,send_request_date FROM msdb..sysmail_allitems
order by mailitem_id desc


select * from msdb..sysmail_event_log
select * from msdb..sysmail_faileditems
select * from msdb..sysmail_sentitems