Please help me on - How to troubleshoot database mail.

  • HI... Please help me on - How to troubleshoot database mail.

    My Database mail was working fine suddenly its stooped working.

    When i m running below command. its result is - Mail queued.

    But its not sending mail. Please help me on this.

    EXEC sp_send_dbmail @profile_name = 'DB_MAIL',

    @recipients = 'abcd@abcd.com',

    @subject = 'Test message',

    @body = 'Congrats Database Mail Received By you Successfully'

  • I've found the database mail system to be pretty reliable, so you have to ask yourself what changed between the time it was working and the time it stopped working. It might not even involve SQL Server at all, but something is causing the problem.

    You can see the message received back from the SMTP server by querying the msdb.dbo.sysmail_event_log table. If you send a test email and there isn't a lot of mail being sent, it should be one of the last rows. This will get you the newest 10 rows, but if you need more information about the email, you can join it to msdb.dbo.sysmail_mailitems on mailitem_id.

    SELECT TOP 10 mailitem_id, event_type, description

    FROM msdb.dbo.sysmail_event_log

    ORDER BY mailitem_id desc;

    Take a look at the exact message and it should tell you where to go from there. If the message indicates success, then you'll probably need to look elsewhere. Examples include the mail server being backlogged and not sending, the email being caught in the receiving server's spam filter and the email being caught in your spam filter.

  • Thank you for your reply.

    My database mail was stooped working from 19th.

    When I ran given code by you. I got below result. Please help me on this..

    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2015-08-01T19:27:42). Exception Message: Cannot send mails to mail server. (The operation has timed out.). )

  • rajeshjaiswalraj (8/21/2015)


    Thank you for your reply.

    My database mail was stooped working from 19th.

    When I ran given code by you. I got below result. Please help me on this..

    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2015-08-01T19:27:42). Exception Message: Cannot send mails to mail server. (The operation has timed out.). )

    Excellent - your answer is right there in the error message.

    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2015-08-01T19:27:42). Exception Message: Cannot send mails to mail server. (The operation has timed out.). )

    If the mail server isn't accepting the email from SQL Server, that's why it isn't being delivered. I see two options at this point:

    1. Talk to your mail server administrator. This will be the person who can tell you what changed, simply fix what's not working or white-list the SQL Server. They'll know better what they have to do to the mail server to get it working again. If you can tell them when you noticed it stopped working, that'll help them determine if they installed any OS patches, installed software patches or made networking changes at that time. Or it may be something unrelated, like your Exchange server is out of space on the drive where its database is stored.

    2. Specify a different mail server. In the account properties associated with the profile, you get the specify the SMTP mail server that SQL is to use to deliver database mail. You can specify a new one using either name or IP address.

  • this is my test server which i m using in my local system.. I m using gmail for this... please help me on this.. I have 6 Instance running on my system .. none of instance are working for DB mail.

  • rajeshjaiswalraj (8/22/2015)


    this is my test server which i m using in my local system.. I m using gmail for this... please help me on this.. I have 6 Instance running on my system .. none of instance are working for DB mail.

    I've never used gmail as an SMTP server from database mail.

    Do you have the account configured to use basic authentication and the correct username and password?

  • like previous user mentioned, db mail is very reliable once configured.

    99% of the time, when a failure occurs, it is due to a change in Exchange, Firewall or, rarely, Port settings.

    My first port of call (excuse pun) is invariably the Network team to enquire about recent changes.

Viewing 7 posts - 1 through 6 (of 6 total)

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