Wednesday, March 28, 2012

No entries in Database Mail log (sysmail_event_log)

Hi. I've reviewed the following webpage http://msdn2.microsoft.com/en-us/library/ms189959.aspx and didn't get the answer I was looking for. (Service Broker is running in msdb.)

Essentially, Database Mail isn't logging entries. Using the following example script:

EXEC msdb.dbo.sp_send_dbmail
@.recipients=N'someone@.somewhere.com',
@.body='Message Body',
@.subject ='Message Subject'

I get the result "Mail queued," and I confirm I receive the email.

However, there are no records in the following tables:

select * from sysmail_event_log
select * from sysmail_faileditems
select * from sysmail_unsentitems

There are records that the send-off was a success:

select * from sysmail_sentitems

Database Mail's "Logging Level" to normally set to Normal. I've changed to Verbose and see no change.

Anyone see something I'm missing?

There should not be any records in

sysmail_event_log
sysmail_faileditems
sysmail_unsentitems

for a sucessfully sent email.

There should be a record in

sysmail_sentitems

for a sucessfully sent email.

Search Books Online for information on

sysmail_event_log
sysmail_faileditems
sysmail_unsentitems

|||I don't know... the other servers log messages in sysmail_event_log such as "Activation successful," "DatabaseMail process is started," and "Mail successfully sent" .|||

Contains one row for each Windows or SQL Server message returned by the Database Mail system. (Message in this context refers to a message such as an error message, not an e-mail message.) As suggested Use sysmail_sentitems when you want to see which messages were successfully sent.

BOL confirms:

When troubleshooting Database Mail, search the sysmail_event_log view for events related to e-mail failures. Some messages, such as the failure of the Database Mail external program, are not associated with specific e-mails. To search for errors related to specific e-mails, look up the mailitem_id of the failed e-mail in the sysmail_faileditems view and then search the sysmail_event_log for messages related to that mailitem_id. When an error is returned from sp_send_dbmail, the e-mail is not submitted to the Database Mail system and the error is not displayed in this view.

When individual account delivery attempts fail, Database Mail holds the error messages during retry attempts until the mail item delivery either succeeds or fails. In case of ultimate success, all of the accumulated errors get logged as separate warnings including the account_id. This can cause warnings to appear, even though the e-mail was sent. In case of ultimate delivery failure, all previous warnings get logged as one error message without an account_id, since all accounts have failed.

sql

No comments:

Post a Comment