sql server agent is not sending dbmail

  • Hi everyone,

    i've got a problem with the agent.

    I've create a procedure to check the memory and, in case is too low, to send an alert via sp_send_dbmail,

    this procedure works if I execute it manually, but when I start the job via agent, nothing happens, no error, no mail, nothing.

    it is my understanding that the only difference is the user that start the procedure, but both are sysadmin.

    The job success with no error, have u got any ideas about the solution?

    many thanks!!! 🙂

  • Are there rows entered in the [sysmail%] tables?

    -- show a list of all mailed items

    SELECT

    sysmail_allitems.mailitem_id

    , sent_status

    , recipients

    , subject, body

    , send_request_date

    , send_request_user

    , sent_date

    , sysmail_allitems.last_mod_date

    , sysmail_event_log.event_type

    , sysmail_event_log.description

    FROM msdb.dbo.sysmail_allitems

    LEFT OUTER JOIN msdb.dbo.sysmail_event_log

    ON sysmail_allitems.mailitem_id = sysmail_event_log.mailitem_id

    order by

    send_request_date desc

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • the sent_status is "failed" in all the rows about the agent's attempts, and the description of the error is the following:

    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 3 (2013-07-24T11:41:12). Exception Message: Could not write to temp attachment file. (Illegal characters in path.). )

    does it mean that i can't send the query result in the attachment file? i'll try to find out,

    many thanks,

    it really helps!!!

  • Try to see how the filename of the attachment is detemined. I guess the attachment will be named according to the alert name. Probably there is an illegal character (like a "\" or "/") that can't be used inside a filename.

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • Hey hi there.

    I have been looking for the same thing..... need a procedure to check memory and alert me when memory is low.

    Please can you post here that SP?

    Thanx in advance.

  • yes I used the illegal character "à"

    now it works!!

    thanks a lot!! :-D:-D

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

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