Home > SQL Server, T-SQL > SQL Sever DB Mail Logs

SQL Sever DB Mail Logs

If you use SQL Server Database mail sometimes you will have trouble and you want to see a log of all the emails that have been sent or failed to send.

To do this there are some management views that will help check what has been going on:

select * from msdb.dbo.sysmail_allitems
Order By mailitem_id desc

select * from msdb.dbo.sysmail_faileditems;

Note Also if you need to force a restart of the DBMail service, then use the following:

exec msdb.dbo.sysmail_stop_sp;
exec msdb.dbo.sysmail_start_sp;
VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)
SQL Sever DB Mail Logs, 10.0 out of 10 based on 1 rating
Categories: SQL Server, T-SQL Tags:
  1. No comments yet.
  1. No trackbacks yet.