Solved

how to get Sql Database Email confirmation status

Posted on 2010-08-24
3
888 Views
Last Modified: 2013-11-30
Hi Experts,

I have created a scheduled job, which sends emails using msdb.dbo.sp_send_dbmail.
I can successfully send emails, now I want to find whether that email is been sent sucessfully or not, and it is delived.
I can get a sent_status from msdb.dbo.sysmail_mailItems table, but I want to have the exact delivery status.

Is any way I can find this ?
0
Comment
Question by:RETAILREALM
  • 2
3 Comments
 
LVL 6

Expert Comment

by:robbe
ID: 33508588
You can use:

EXECUTE msdb.dbo.sysmail_help_queue_sp ;
GO

more info on:
http://technet.microsoft.com/en-us/library/ms187400.aspx
0
 

Author Comment

by:RETAILREALM
ID: 33508856
Hope I am not missing something there,
but can you specify how I can get that , in 10 emails these 9 are sent , 1 is in queue, 8 are successfully delivered and 1 is failed.

I cant see any clue by using above store procedure.

Thanks, please correct me if I am wrong.
0
 

Accepted Solution

by:
RETAILREALM earned 0 total points
ID: 33509589
ok, I found it

http://technet.microsoft.com/en-us/library/ms191278(SQL.90).aspx

which sayss
Database Mail keeps copies of outgoing e-mail messages and displays them in the sysmail_allitems, sysmail_sentitems, sysmail_unsentitems, sysmail_faileditems views of the msdb database. The Database Mail external program logs activity and displays the log through the Windows Application Event Log and the sysmail_event_log view in the msdb database. To check the status of an e-mail message, run a query against this view. E-mail messages have one of four possible statuses: sent, unsent, retrying, and failed.


And its perfect answer.


 
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
I have a large data set and a SSIS package. How can I load this file in multi threading?
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now