Database Mail error

  • Hey guys,

    I can set up Database Mail through pointing and clicking in SSMS, and send out a test email. But whenever I set up a SQL Server Agent job to send out nightly emails, it returns this error:

    Message

    [264] An attempt was made to send an email when no email session has been established

    I have set this up on a few different servers... tried deleting and recreating everything... same problem.

    Any help is appreciated.

  • Gander at this: http://msdn.microsoft.com/en-us/library/ms188663.aspx. In the MSDB database, there are system tables that you can query to see the exact error and status of your Agent initiated message and debug from there.

    Jim Murphy
    http://www.sqlwatchmen.com
    @SQLMurph

  • @jim: Thanks for the resource. I checked the sysmail_event_log, but it only showed errors from test emails I sent unsuccessfully before the mail was set up properly.

    To clarify a little bit, the section I have set up to send out email is in the properties of a SQL Server Agent job, Notifications page, then check e-mail, set an operator, and set next dropdown to "when job completes".

  • bump !

  • my google-fu pointed me to an issue where SQL server Agent needs to be restarted, based on this MS article?

    http://social.msdn.microsoft.com/forums/en-US/sqltools/thread/32a2c09a-156f-43b2-9076-b11ba9ccdafb/

    do you think that could be the issue? that db mail was setup after the agent was started, and it needs to stop and start to re-establish running values and queues?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • No, restarting SQL Server Agent and the Windows Server box several times has not remedied the error.

  • From my experience this works..

    With sql serveragent properties, uncheck the Enable mail profile box.

    Stop and restart sqlserveragent

    Now Check the Enable mail profile box

    Stop and restart sqlserveragent.

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

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