sp_send_dbmail

D

Don Juan

Hello all

I was running my application in my computer, the sp_send_email worked fine,
once I put this application in IIS 6.0 I receive this error message (see
bellow please).
Sys.WebForms.PageRequestManagerServerErrorException:
EXECUTE permission denied on object 'sp_send-dbmail', database 'msdb',
schema 'dbo'.

I googled and I found this: here:
http://msdn.microsoft.com/en-us/library/ms188719.aspx

To send Database mail, users must be a user in the msdb database and a
member of the DatabaseMailUserRole database role in the msdb database. To
add msdb users or groups to this role use SQL Server Management Studio or
execute the following statement for the user or role that needs to send
Database Mail.

EXEC msdb.dbo.sp_addrolemember @rolename = 'DatabaseMailUserRole'
,@membername = '<user or role name>';
GO

My question is: which role and user must I specify? knowing that people uses
the application ussing the credentials creeated id ASP Configuration Tool?
They are no database users.
Must I specify an account in particular?

Thanks and kind regards.
 
D

Don Juan

Here you have the connection string I use:
Data Source=server03;Initial Catalog=HR;Integrated Security=True

Log on to the server
Use Windows Authentication

How can I know the user?

Cheers
 
S

sloan

SELECT SYSTEM_USER

SELECT SUSER_SNAME()



when you say "Integrated Security=True", you're passing in the credentials
of the current logged in user (usually) OR the account that is running the
code.

If its a website, then it is probably running under the MyMachine\ASPNET
account.



Its VERY IMPORTANT you understand which account something is running. It
will cause deployment issues if you don't understand this.



Google this:

http://www.google.com/search?hl=en&q=sql+authentication+vs+windows+authentication&aq=3&oq="sql+auth

for a better understanding of how Sql Server deals with the methods.
 
D

Don Juan

Thanks!

sloan said:
SELECT SYSTEM_USER

SELECT SUSER_SNAME()



when you say "Integrated Security=True", you're passing in the credentials
of the current logged in user (usually) OR the account that is running the
code.

If its a website, then it is probably running under the MyMachine\ASPNET
account.



Its VERY IMPORTANT you understand which account something is running. It
will cause deployment issues if you don't understand this.



Google this:

http://www.google.com/search?hl=en&q=sql+authentication+vs+windows+authentication&aq=3&oq="sql+auth

for a better understanding of how Sql Server deals with the methods.
 
A

Alexander Osorio

Hola, cuando se postea en este foro debería tener la gentileza de hacer el
esfuerzo y preguntar en "idioma español", nosotros cuando posteamos en otros
foros lo intentamos hacer en su propio idioma.
Gracias y disculpe.
 
D

Don Juan

Normalmente lo hago.
Sorry.

Alexander Osorio said:
Hola, cuando se postea en este foro debería tener la gentileza de hacer el
esfuerzo y preguntar en "idioma español", nosotros cuando posteamos en
otros foros lo intentamos hacer en su propio idioma.
Gracias y disculpe.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top