Cannot send mail with sp_send_dbmail

  • Hello,

    I have a very frustrating problem with my new sql server 2005 x64 SP setup.

    I am configuring the database mail to send mail using the sp_send_dbmail stored procedure.

    When i setup de databasemail I can send a test mail which is delivered instantly.

    But when I use the sp_send_dbmail it is not deliverd. The SP returns 'Mail queued' which is correct.

    When I query the sysmail_allitems I can see the mail items and they all have the status 'sent' in sent_status.

    I already installed the SMTP service on the server. The profile uses the administrator as user and the SQL Server service also uses this account.

    Does anybody have an idea what I am missing ?

    Thanx in advance for your sugestions.

    Kind regards,

    Tim

  • check logon account for sql server agent.

    keep it same as that of sql service and then retry.

  • Both services have the same startup account.

    I restarted both services but problem persists.

  • I found the solution.

    Apparantly the length of the @Subject parameter had to be filled out.

    This was a configuration on the exchange server.

    Thanx.

    This can be closed.

  • Restart SQL Agent.

  • It was the intelligent message filtering rating which was set too low.

    This prefented the exchange server of delivering messages without a subject or of messages with a subject and/or body which was too short.

    After changing this level I was able to send any kinds of messages.

    The test message succeeded because this had a body and subject which was long enough.

    Kind regards,

    Tim

  • how did you recognise that it is set in exchange server??

    do you found any error report or log in sql anywhere??

  • I didn't find anything in the sql logs.

    The status of the messages where all 'sent' so technet adviced to check the exchange settings.

    I found the solution by copying the syntax for the sp_send_dbmail tsql from BOL in a query window.

    This message was send because the subject and body was long enough.

    Then I tried with different lengths which lead me to the solution.

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

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