![]() ![]() You can check these views for problems with specific emails to see whether database mails are being sent, are stuck in the queue, or fail to be sent. ![]() Step 2: Check sysmail_unsentitems, sysmail_sentitems, and sysmail_faileditems views When an error is returned from sp_send_dbmail, the email isn't submitted to the Database Mail system and the error isn't displayed in the sysmail_event_log view. To search for errors that are related to specific emails, look up the mailitem_id of the failed email in the sysmail_faileditems view, and then search for messages that are related to mailitem_id in sysmail_event_log. If there are no problems with Database Mail external executable, go to the sysmail system views. Failure to authenticate with the SMTP server.If the external program can't log to the msdb tables, the program will log errors to the Windows application event log. The following issues might be logged in sysmail_event_log:įailure of DatabaseMail.exe to connect to SQL Server. Issues that may be logged in sysmail_event_log If the delivery fails in the end, all previous warnings get logged as one error message without an account_id because all accounts have failed. It can cause a warning even if the email was sent. If the delivery succeeds in the end, all accumulated errors get logged as separate warnings, including account_id. When individual account delivery attempts fail, Database Mail will hold the error messages during retry attempts until the mail item delivery succeeds or fails. You should gather statement-level profiler trace and troubleshoot the error that you encounter. ![]() To show only the required event types, use the WHERE clause to filter. The event_type column can have the following values: Run the following query to sysmail_event_log: SELECT er.log_id AS , In SQL Server Management Studio (SSMS), select Management, right-click Database Mail, and select View Database Mail Log to check the Database Mail log as follows: Sysmail_event_log contains one row for each Windows or SQL Server message that's returned by the Database Mail system. Some messages (such as the failure of the Database Mail external program) aren't associated with specific emails. When troubleshooting Database Mail, search the sysmail_event_log view for events that are related to email failures. This system view is the starting point for troubleshooting all Database Mail issues. Some errors are logged in the Windows application event log. Information about messages that Database Mail is currently trying to send. Information about messages that have been sent by using Database Mail. Information about attachments to Database Mail messages. Information about messages that Database Mail could not send. Lists messages about the behavior of the Database Mail external program. Lists all messages that are submitted to Database Mail. You can query these views directly in your environment. Most relevant logging occurs in the msdb sysmail system view. Msdb sysmail system viewsīefore looking at the detailed steps, here is a quick summary of the relevant Database Mail system views. You can use the following steps for initial Database Mail troubleshooting.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |