Database Mail Troubleshooting

  • I am analyzing why a sp_send_dbmail states 'mail queued', yet I never receive the email....

    My question is this; when I look in the log, why am I seeing Mail Stop / Start messages every 10 minutes?

    Thanx!

    Jude

  • There may a couple of reasons you did not receive the meanth mail.

    - check you db-mail objects to see if it has problems

    use msdb

    go

    exec sysmail_help_queue_sp -- @queue_type = 'Mail'

    go

    select *

    -- delete

    from sysmail_event_log

    order by log_date

    select *

    from sysmail_mailattachments

    select *

    from sysmail_allitems

    /*

    ********** cleanup old messages **********

    Declare @sent_before datetime

    Select @sent_before = dateadd(MM,1,dateadd(dd,datediff(dd,0,getdate()),0))

    print convert(varchar(26),@sent_before,121)

    exec sysmail_delete_mailitems_sp @sent_before = @sent_before

    , [ @sent_status = ] 'sent_status' ]

    */

    /*

    SELECT [account_id]

    ,[name]

    ,[description]

    ,[email_address]

    ,[display_name]

    ,[replyto_address]

    ,[last_mod_datetime]

    ,[last_mod_user]

    FROM [msdb].[dbo].[sysmail_account]

    SELECT [attachment_id]

    ,[mailitem_id]

    ,[filename]

    ,[filesize]

    ,[attachment]

    ,[last_mod_date]

    ,[last_mod_user]

    FROM [msdb].[dbo].[sysmail_attachments]

    SELECT [transfer_id]

    ,[uid]

    ,[filename]

    ,[filesize]

    ,[attachment]

    ,[create_date]

    FROM [msdb].[dbo].[sysmail_attachments_transfer]

    SELECT [mailitem_id]

    ,[profile_id]

    ,[recipients]

    ,[copy_recipients]

    ,[blind_copy_recipients]

    ,[subject]

    ,[body]

    ,[body_format]

    ,[importance]

    ,[sensitivity]

    ,[file_attachments]

    ,[attachment_encoding]

    ,[query]

    ,[execute_query_database]

    ,[attach_query_result_as_file]

    ,[query_result_header]

    ,[query_result_width]

    ,[query_result_separator]

    ,[exclude_query_output]

    ,[append_query_error]

    ,[send_request_date]

    ,[send_request_user]

    ,[sent_account_id]

    ,[sent_status]

    ,[sent_date]

    ,[last_mod_date]

    ,[last_mod_user]

    FROM [msdb].[dbo].[sysmail_mailitems]

    SELECT [profile_id]

    ,[principal_sid]

    ,[is_default]

    ,[last_mod_datetime]

    ,[last_mod_user]

    FROM [msdb].[dbo].[sysmail_principalprofile]

    SELECT [profile_id]

    ,[name]

    ,[description]

    ,[last_mod_datetime]

    ,[last_mod_user]

    FROM [msdb].[dbo].[sysmail_profile]

    SELECT [profile_id]

    ,[account_id]

    ,[sequence_number]

    ,[last_mod_datetime]

    ,[last_mod_user]

    FROM [msdb].[dbo].[sysmail_profileaccount]

    SELECT [uid]

    ,[text_data]

    ,[create_date]

    FROM [msdb].[dbo].[sysmail_query_transfer]

    SELECT [conversation_handle]

    ,[mailitem_id]

    ,[send_attempts]

    ,[last_send_attempt_date]

    FROM [msdb].[dbo].[sysmail_send_retries]

    SELECT [account_id]

    ,[servertype]

    ,[servername]

    ,[port]

    ,[username]

    ,[credential_id]

    ,[use_default_credentials]

    ,[enable_ssl]

    ,[flags]

    ,[last_mod_datetime]

    ,[last_mod_user]

    FROM [msdb].[dbo].[sysmail_server]

    SELECT [servertype]

    ,[is_incoming]

    ,[is_outgoing]

    ,[last_mod_datetime]

    ,[last_mod_user]

    FROM [msdb].[dbo].[sysmail_servertype]

    */

    - It may also be your mail system that blocks your mails from being received. Contact your mail-admin for help.

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply