July 10, 2009

Resolving the error - EXECUTE permission denied on object 'sp_send_dbmail', database 'msdb', schema 'dbo'




Recently, a viewer mailed me asking about an error in Database Mail. The error was EXECUTE permission denied on object sp_send_dbmail, database 'msdb', schema 'dbo'.

The error means that the user who is trying to send Database Mail does not have the required permissions to execute sp_send_dbmail. To be able to send mail using Database mail, a user has to be a member of the ‘DatabaseMailUserRole’ role in the msdb database. Here’s how to add the user to this role

USE msdb
EXEC msdb.dbo.sp_addrolemember @rolename = 'DatabaseMailUserRole',
@membername = 'SomeDomain\SomeDomainUser';
GO
After successful execution of this statement, the error should be fixed.


Did you like this post?
kick it on DotNetKicks.com
subscribe via rss subscribe via e-mail
print this post follow me on twitter


About The Author

Suprotim Agarwal, ASP.NET Architecture MVP works as an Architect Consultant and provides consultancy on how to design and develop Web applications.

Suprotim is also the founder and primary contributor to DevCurry, DotNetCurry and SQLServerCurry. He has also written an EBook 51 Recipes using jQuery with ASP.NET Controls.

Follow him on twitter @suprotimagarwal

 
  Feedback:

comments

0 Responses to "Resolving the error - EXECUTE permission denied on object 'sp_send_dbmail', database 'msdb', schema 'dbo'"
 

Copyright © 2009-2014 All Rights Reserved for SQLServerCurry.com by Suprotim Agarwal | Terms and Conditions