Troubleshoot DBmail

  • Hi,

    On a Sql Server 2005 I have DBMail setup and correctly configured. I am able to use "Notify Operator" and "EXEC msdb.dbo.sp_send_dbmail " to queue emails.

    But the problem is the queued mails never go through. I see 10 emails in the queue when I query "SELECT * FROM msdb.dbo.sysmail_unsentitems"

    But if I restart the Sql Server Service, all mails go through and I receive emails in my inbox.

    So far this is the only pattern I could find.

    So my question is: Is there a way to troubleshoot DBmail. I read some steps on MSDN, but they are not of much help. Any URLs to articles that could help are much appreciated.

    thanks,

    _UB

  • This happened only for the first time or you need to restart the SQL Server everytime ? Try refreshing the DBMail from the DB_Mail Monitor.

    Thank You,

    Best Regards,

    SQLBuddy

  • check the Service Broker and endpoints

    -- Enable Service Broker:

    ALTER DATABASE [Database Name] SET ENABLE_BROKER;

    -- Disable Service Broker:

    ALTER DATABASE [Database Name] SET DISABLE_BROKER;

    --Check for the specific database

    SELECT is_broker_enabled,* FROM sys.databases WHERE name = 'Database name';

    Regards,
    Syed Jahanzaib Bin Hassan
    BSCS | MCTS | MCITP | OCA | OCP | OCE | SCJP | IBMCDBA

    My Blog
    www.aureus-salah.com

  • Is SQL Agent Started? Database Mail is sent out by SQL Agent

    Chris Powell

    George: You're kidding.
    Elroy: Nope.
    George: Then lie to me and say you're kidding.

  • Yes, Sql Agent is also restarted along with Sql Server Service. This make me wonder, if the mails are processed when the Agent is restarted or the Sql Service. I will check this and get back to you.

    thank you for your input.

    Edit: Emails go through when Sql Agent is restarted. So Sql Service restart is not needed, I guess.

  • Happens every time I restart Sql. What is DB mail monitor? I did refresh DBmail from SSMS.

    Edit: Emails go through when Sql Agent is restarted. So Sql Service restart is not needed, I guess.

  • This is beginning to sound more and more like an SMTP issue. Can you "white list" the SQL Server IP address on the mail server and try again?

    Chris Powell

    George: You're kidding.
    Elroy: Nope.
    George: Then lie to me and say you're kidding.

  • Service broker is enabled for msdb, the emails originate from either maintenance plans or jobs.

  • Thank you for your input.

    I am not sure I know how to do that. Also I do not have any control over SMTP Server since this is PROD. It was hard to get approved for Sql DBmail as it is.

    Also, it does not seem like SMTP issue (I could be wrong, but not sure). Mails get queued, but do not go through to SMTP Server. But on Agent restart they are all processed.

Viewing 9 posts - 1 through 8 (of 8 total)

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