Query to tell us the error for failed SQL server email sent_status=2

First we can check the status (sent_status) of the email:

SELECT *
FROM [msdb].[dbo].[sysmail_mailitems]
where [recipients] = ‘xyz@abc.com’
and subject = ‘AAAAA’
order by sent_date desc

Now get the  mailitem_id  and look up in the view sysmail_event_log using query:

select * FROM [msdb].[dbo].[sysmail_event_log]

where mailitem_id = 123456

The field description will show us the actual error.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s