Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.sqlserver.server > #18802

SP_SEND_DBMAIL - Issue

Newsgroups microsoft.public.sqlserver.server
Date 2017-09-11 08:32 -0700
Message-ID <aa15d7d9-e9d6-4329-a0ae-037230952b99@googlegroups.com> (permalink)
Subject SP_SEND_DBMAIL - Issue
From chapman.s.1982@gmail.com

Show all headers | View raw


Hi ,

Thanks for reading this. 

I'm using the following code to send an e-mail from an SQL SP:

      -- All the parameters are initialised correctly before this call
      EXEC  MSDB.DBO.SP_SEND_DBMAIL
            @profile_name = @profile_name,
            @recipients   = @Recipient,
            @subject      = @subject,
            @body         = @body,
            @body_format  = @body_format,
            @from_address = 'Job Notifocation<noreply@mycompany.com>'

*) The normal users get an error when they run my SP: 'Profile name is not found'. 

*) But the above call works OK when the sa runs it. 

I have checked the following:
-------------------------------------------------------------------
1. The user AD group is added to MSDB as DatabaseMailUserRole.
2. There is GRAMNT EXECUTE ON MSDB.DBO.SP_SEND_DBMAIL

The call still fails for normnal users. Any help greatly appreciated.

S

Back to microsoft.public.sqlserver.server | Previous | Next | Find similar


Thread

SP_SEND_DBMAIL - Issue chapman.s.1982@gmail.com - 2017-09-11 08:32 -0700

csiph-web