{"id":1012,"date":"2014-01-06T15:59:37","date_gmt":"2014-01-06T04:59:37","guid":{"rendered":"http:\/\/ntsblog.homedev.com.au\/?p=1012"},"modified":"2014-01-06T16:45:44","modified_gmt":"2014-01-06T05:45:44","slug":"sql-server-dbmail-logs","status":"publish","type":"post","link":"https:\/\/ntsblog.homedev.com.au\/index.php\/2014\/01\/06\/sql-server-dbmail-logs\/","title":{"rendered":"SQL Sever DB Mail Logs"},"content":{"rendered":"<div id=\"ntsbl-988438183\" class=\"ntsbl-before-content ntsbl-entity-placement\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-6288941070289539\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:inline-block;width:728px;height:90px;\" \ndata-ad-client=\"ca-pub-6288941070289539\" \ndata-ad-slot=\"9356781486\"><\/ins> \n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div><p>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.<\/p>\n<p>To do this there are some management views that will help check what has been going on:<\/p>\n<p>[sql]<br \/>\nselect * from msdb.dbo.sysmail_allitems<br \/>\nOrder By mailitem_id desc<\/p>\n<p>select * from msdb.dbo.sysmail_faileditems;<br \/>\n[\/sql]<\/p>\n<p>Note Also if you need to force a restart of the DBMail service, then use the following:<\/p>\n<p>[sql]<br \/>\nexec msdb.dbo.sysmail_stop_sp;<br \/>\nexec msdb.dbo.sysmail_start_sp;<br \/>\n[\/sql]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[13,28],"tags":[],"class_list":["post-1012","post","type-post","status-publish","format-standard","hentry","category-sql-server","category-t-sql"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/posts\/1012","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/comments?post=1012"}],"version-history":[{"count":0,"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/posts\/1012\/revisions"}],"wp:attachment":[{"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/media?parent=1012"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/categories?post=1012"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ntsblog.homedev.com.au\/index.php\/wp-json\/wp\/v2\/tags?post=1012"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}