Database Mail Views (Transact-SQL)

APPLIES TO: yesSQL Server noAzure SQL Database noAzure Synapse Analytics (SQL DW) noParallel Data Warehouse

Database Mail has the following views for displaying Database Mail e-mail content, status of e-mails, and any messages received, such as errors logged by Database Mail. These views are in the msdb database.

sysmail_allitems (Transact-SQL) sysmail_mailattachments (Transact-SQL)
sysmail_event_log (Transact-SQL) sysmail_sentitems (Transact-SQL)
sysmail_faileditems (Transact-SQL) sysmail_unsentitems (Transact-SQL)

See Also

Database Mail
Database Mail Configuration Objects
Database Mail Stored Procedures (Transact-SQL)