Recently I had to configure Database mail in one of the production SQL Server estate to send Log shipping Alerts. Database email has been configured and it was successfully sending test emails through the SQL Server. However when I try to configure the log shipping alerts (Log shipping Primary Server Alert and Log shipping Secondary Server Alert) to send email through operators, it was keep failing to send email and rising below error messages in SQL Server Agent Error logs.
Message An attempt was made to send an email when no email session has been established
I want to share the quick fix for this issue. See below the steps.
Right click SQL Server Agent
Go to Properties and select Alert System tab
Enable mail profile
Select Database mail as Mail system
Select particular mail profile
Right click SQL Server Agent and restart the service.