Today I had a requirement of finding the details of mails that sent using Database Mail feature. "sysmail_allitems" catalog view will contains the details like subject,body,recipients,CC,BCC,status,send date,file attachment etc. check out following query.
USE MSDB GO SELECT [subject],body, recipients,copy_recipients, blind_copy_recipients,sent_status, sent_date,file_attachments FROM sysmail_allitems GO
Published under: SQL Server Tips · · · ·