Thursday, January 10, 2008

Troubleshooting SQL server database mail

I am putting database mail on SQL server 2005 into use more and more these days with my consutling projects and it is making things much easier on me.

It is very easy to trigger emails based on transactions that happen on the database - like payments posted, account goes below a certain balance etc.

It is also nice to use some of the included views to see what is the status of your email messages.

If a message that I send did not reach the recipient I can check:
SELECT * FROM msdb.dbo.sysmail_faileditems
to look for that message.

Once I find it there I can can look at the mailitem_id in the msdb.dbo.sysmail_event_log view.

Happy mailing!

No comments: