SQL Agent Alert System Error: [264] An attempt was made to send an email when no email session has been established

Today, I received an email from the development team complaining why they have not received any of the SQL Agent job notification emails today. Upon checking the SQL Agent error log, I see the following error message:

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

SQLAgent_ErrorLog

To investigate the issue, I followed the steps below to verify that SQL Server Agent Alert System is configured correctly and is associated with the correct Database Mail profile:

  • Right Click on SQL Server Agent, Select properties.
  • Select Alert System.
  • Select Enable mail profile.
  • Select OK.

I also successfully sent a test email using this Database Mail profile.

Although, I verified above settings and sent test emails using Database Mail, SQL Server Agent Job was still unable to notify the SQL Server Agent Operator. At this point, I decided to Google this error message because I was not sure why this error is occurring. After digging around online, I realized I just need to restart the SQL Server Agent service. After I restarted SQL Server Agent service, SQL Server Agent job notifications started working again.

10 thoughts on “SQL Agent Alert System Error: [264] An attempt was made to send an email when no email session has been established

  1. yeah
    MS as always….configuring it, applying succesfull, but why not mention the need to restart the service or even better….ask to restart the service……ready steady go…..

    Like

      • Hi Shannon, it isn’t true. Can you look at your SQL Agent properties and find out the name of database mail profile it is using. Try sending test email using that profile.

        Like

      • Yes, that works fine.

        I added the account that the SQLAgent service is running as to the msdb DatabaseMailUser (sp?) group. I checked everything in the configuration and security settings per MS TechNet, books online, and SQL MSDN. I stopped and started SQLAgent, several times, and the db engine too. Nothing worked.

        I set up a job and used sp_send_dbmail (sp?) to send a message when the job ran. That worked fine. So it’s not SQLAgent access to dbmail that’s broken. It’s the ‘notify operator’ function.

        So I added a ‘send mail’ step to all my jobs so that on failure it will run a sp that sends the fail notice. I called a sp so there is only one place to edit if the email needs to change.

        That meets our needs at the moment but I would still like to fix the “email to Operator” function.

        Like

  2. The error log just has the [264] message. Yes I bounced the Agent and the Server itself. Still not working.

    One other variable that I am not sure could be contributing, this is the default instance on this box and there is one named instance too.

    It’s also WinServer 2008 on a VMware virtual machine, SQL is 2008 R2.

    Like

  3. Hi Farooq,
    Recieving the below message in the error log.please suggest me hoe to troubleshoot this.
    [264] An attempt was made to send an email when no email session has been established

    Like

  4. Pingback: Fix Sql Agent Error Creating A New Session Windows XP, Vista, 7, 8 [Solved]

Leave a comment