EXECUTE permission was denied on the object 'sp_send_dbmail', database 'msdb', schema 'dbo' RRS feed

  • Question

  • I could not find a sub-forum for SQL Server to which this applies, so I would welcome any suggestions as to where to post it.

    Here is the problem: I have a VB.Net 2008 solution that sends an XML string to another agency. The data reaches the other agency, but I get the following error message:

    System.Web.Services.Protocols.SoapException: Server was unable to process request. --> The EXECUTE permission was denied on the object 'sp_send_dbmail', database 'msdb', schema 'dbo'.

       at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)

       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

       at CrimNetCLGrandJury.PCSCAgave.GJFeed.Send(String xmlFeed)

       at CrimNetCLGrandJury.FeedControl.CreateFeed_Click(Object sender, EventArgs e)


    We do not use the sp_send_dbmail stored proc at all.


    • Moved by Sethu Srinivasan Friday, November 2, 2012 12:12 AM dbmail (From:Getting started with SQL Server)
    Monday, October 27, 2008 11:38 PM


All replies

  • You need to grant execute permission for that sp to the login which tries to execute the sp.

    Use msdb
    Grant EXEC on sp_send_dbmail to user

    - Deepak

    Tuesday, October 28, 2008 12:45 AM
  • the user that you are using just has READ or view permissions, you need to navigate to your database security, then Users, then select this user and in the Database role membership: grant a db_owner permissions and it will work just fine :)

    Maher Abu Zer Software Development Officer
    • Proposed as answer by Maher Abu Zer Wednesday, April 20, 2011 11:33 AM
    Wednesday, April 20, 2011 11:33 AM
  • If db_owner permissions doesn't apply , DatabaseMailUserRole could be enough for sending mail :

    USE [msdb]
    EXEC sp_addrolemember N'DatabaseMailUserRole', N'DB_SSIS_USER'

    where DB_SSIS_USER is the SQLUser.




    Thursday, July 14, 2011 12:58 PM
  • Hi Joe,

    Please read this article for Solution


    Arunraj Chandrasekaran, MCTS, Author: SQLXpertise.com
    If you found this post useful, Please "Mark as Answer" or "Vote as Helpful"
    Thursday, July 14, 2011 1:13 PM
  • also here http://msdn.microsoft.com/en-us/library/ms187540.aspx


    Thursday, July 14, 2011 1:36 PM