Thursday, April 25, 2013

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

You may come across a scenario where you will be able to send mails through DB Test mail but the notifications configured on the job schedules will not trigger any mails on job failures/success…So what’s wrong???
As a first step you need to check whether SQL Server agent is configured to use DB MAIL profile or not,below are the steps to check the same….

• Right click on SQL Server Agent Select PropertiesSelect ALERT SYSTEM tab Make sure that ENABLE MAIL PROFILE is checkedSelect mail profile Click on OK.

o So if above is not enabled this is reason of your behavior if in case if you are facing the error in spite of enabling this setting then follow the below steps for resolution.

• These steps need your SQL AGENT to be restarted so please be careful to check on any running jobs and go ahead ….
o Uncheck “Enable Mail profile” on SQL Agent Properties. Stop the Agent and Start the Agent.
o Now Enable database mail in properties and restart the SQL Server Agent.
o This will let you to get rid of error message “An attempt was made to send an email when no email session has been established” and you will be able to successfully get the mail from the agent notification on Job failures/Success

No comments:

Post a Comment