If your SQL applications can’t send email using database mail (I assume you already have DBMail Account and Profile setup), there are two things to set:

  1. SQL MANAGEMENT STUDIO > MANAGEMENT > DATABASE MAIL > right click and select CONFIGURE… > select MANAGE PROFILE SECURITY >
    1. put a check on PUBLIC option
    2. click on DEFAULT PROFILE (Yes, I know it does not appear to be clickable… but it is) and set it to YES
  2. SQL MANAGEMENT STUDIO > DATABASES > SYSTEM DATABASES > right click on MSDB and select NEW QUERY > then enter > grant execute on sp_send_dbmail to public and click OK

In my case I was seeing errors like:

The EXECUTE permission was denied on the object ‘sp_send_dbmail’, database ‘msdb’, schema ‘dbo’.

So the fix, or at least the root cause was more obivous than some errors.

This was the same in SQL 2008, R2 and I just had to run through this again in SQL 2012.

Thanks to Darren from www.NeoSystems.com for his fine assistance with this fix.


4 Comments

Raphael Lima · February 3, 2020 at 7:28 am

I love you. thank you

Tony · August 23, 2019 at 12:55 am

Thanks

Naveen · June 1, 2018 at 4:14 am

It is really helpful for me.

Eder Jimenez Garcia · September 23, 2014 at 11:42 am

I can solved this error whith this script… thank you. You can not imaginate how much it help me…. best regards

Leave a Reply to Naveen Cancel reply

Avatar placeholder

Your email address will not be published. Required fields are marked *