Mail Works, but not from Job Notification

  • I cannot seem to get a scheduled job to notify me by email when it completes. I set up mail, and the test works. I also ran this, which also works:

    EXEC msdb.dbo.sp_send_dbmail

    @profile_name = 'SQL_Mail',

    @recipients = 'me@work.com',

    @body = 'SQL_Mail 2005 Test ',

    @subject = 'SQL_Mail 2005 Test '

    But if I use an existing job, or a new job, and set notification when the job completes, I do not get an email, or any errors. I've looked at the specs of the operator, and it looks correct too. I've compared it with the operator on another 2005 machine and they are the same.

    The problem machine was just upgraded from 2000 to 2005. I'm not experiencing any other issues with the upgrade.

    Any thoughts ?

  • Hi,

    In the case SMTP mail is sent but is not received, I normally ask a person who is responsible for our SMTP server to check SMTP server logs. There cold be rules that only domain users's messages can be relayed etc. When you execute the posted statements, make sure you are logged in as an account the runs your job. For example, if you conenct as your doamin user and send the email, it may pass SMTP server rules. But if your SQL Server and Agent are running on LocalSystem acount and the job belongs to SA, then the job is executed in the security context of the LocalSystem most probably and this account may not have rights on the SMTP server.

    Yelena

    Regards,Yelena Varsha

  • In the properties of the SQL Server Agent, what is the "Alert System" setting for Mail Session. Enable Mail Profile should be checked.

  • SRB (10/9/2007)


    In the properties of the SQL Server Agent, what is the "Alert System" setting for Mail Session. Enable Mail Profile should be checked.

    That was it !! Thanks !

Viewing 4 posts - 1 through 3 (of 3 total)

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