Database Mail : Execute Permission problem

  • Hello,

    I have a problem with Database Mail. Thank you for help ...

    SQL Server 2016 running on Windows Server 2012 R2

    When I try send test message i have problem in application log: "Error Message: The update to the database failed. Reason: The EXECUTE permission was denied on the object 'sysmail_logmailevent_sp' database 'msdb' , schema 'dbo'. "

    I try lots of tips and nothing solved :

    a) SQLAgent and the user is logged on MngStudio are member DatabaseMailUserRole, SysAdmin

    b) I try ...
    GRANT EXECUTE ON OBJECT :: sp_send_dbmail TO DatabaseMailUserRole
    GRANT EXECUTE ON OBJECT :: sp_readrequest TO DatabaseMailUserRole
    GRANT EXECUTE ON OBJECT :: sysmail_logmailevent_sp TO DatabaseMailUserRole
    GRANT EXECUTE ON OBJECT :: sysmail_help_configure_sp TO DatabaseMailUserRole

    c) Result next command no problem

    EXEC msdb.dbo.sysmail_help_configure_sp;
    EXEC msdb.dbo.sysmail_help_account_sp;
    EXEC msdb.dbo.sysmail_help_profile_sp;
    EXEC msdb.dbo.sysmail_help_profileaccount_sp;
    EXEC msdb.dbo.sysmail_help_principalprofile_sp;

    d) SQL Broker running

    e) SQLAgent service i try run under the Administrator account

    I'll be glad for any help!

  • kyssling - Friday, January 20, 2017 10:01 AM

    Hello,

    I have a problem with Database Mail. Thank you for help ...

    SQL Server 2016 running on Windows Server 2012 R2

    When I try send test message i have problem in application log: "Error Message: The update to the database failed. Reason: The EXECUTE permission was denied on the object 'sysmail_logmailevent_sp' database 'msdb' , schema 'dbo'. "

    I try lots of tips and nothing solved :

    a) SQLAgent and the user is logged on MngStudio are member DatabaseMailUserRole, SysAdmin

    b) I try ...
    GRANT EXECUTE ON OBJECT :: sp_send_dbmail TO DatabaseMailUserRole
    GRANT EXECUTE ON OBJECT :: sp_readrequest TO DatabaseMailUserRole
    GRANT EXECUTE ON OBJECT :: sysmail_logmailevent_sp TO DatabaseMailUserRole
    GRANT EXECUTE ON OBJECT :: sysmail_help_configure_sp TO DatabaseMailUserRole

    c) Result next command no problem

    EXEC msdb.dbo.sysmail_help_configure_sp;
    EXEC msdb.dbo.sysmail_help_account_sp;
    EXEC msdb.dbo.sysmail_help_profile_sp;
    EXEC msdb.dbo.sysmail_help_profileaccount_sp;
    EXEC msdb.dbo.sysmail_help_principalprofile_sp;

    d) SQL Broker running

    e) SQLAgent service i try run under the Administrator account

    I'll be glad for any help!

    is you SQL Agent Service part of the fixed SYSADMIN role? 
    the required permissions listed here: https://technet.microsoft.com/en-us/library/ms191543.aspx

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle

  • It is not important for the solution

  • It is not important for the solution
  • It is not important for the solution

  • I finish topic - because i now know necessary for the Database Mail
    use the service NT\SERVICE, and not the Local System.

    (https://technet.microsoft.com/en-us/library/ms191442%28v=sql.105%29.aspx?f=255&MSPPError=-2147217396)
    - Unfortunatelly I have to open a new topic 🙁

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply