RE: EXECUTE permission denied on object 'sp_send_dbmail', database 'ms



If i execute the procedure manually within management studio it works fine,
email is sent and record is updated..

Did you use the same login (to log into the SQL instance) that the web
server was using?

Linchi

"Daniel" wrote:

Im getting this error when trying to execute my stored procedure that has
code within to email

EXECUTE permission denied on object 'sp_send_dbmail', database 'msdb',
schema 'dbo'.

If i execute the procedure manually within management studio it works fine,
email is sent and record is updated..

We have other pages within our site that use similar procedures and they all
work fine.. just dont know why this one isnt..

here is the code within the procedure.. keeping in mind that it works if
manually executed and does NOT if executed from the webpage.

-- send the mail

EXEC msdb.dbo.sp_send_dbmail

@profile_name = 'CESync'

,@recipients = 'dcha@xxxxxxxx'

,@body = @tableHTML

,@subject = 'Credit Memo To Back Out'

,@body_format = 'HTML' ;


--
ASP, SQL2005, DW8 VBScript, Visual Studio 2005, Visual Studio 2008



.