Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 cant send email using DB mail

Author  Topic 

rajani
Constraint Violating Yak Guru

367 Posts

Posted - 2009-10-04 : 18:39:59
Hey all. I'm running SQL 2005 and have set up SQL Mail successfully. some users can send emails through ,it works fine.

but some users cant send email but i dont see any errors in the log. our front end application calls the SP with relavant parameters. see sample code below. do i need give special permissions for these users ? currently these users are all "db_owner" for the DB our application uses. any ideas much appreciated.

EXEC msdb.dbo.sp_send_dbmail @recipients = @emailids,
@subject = @subject,
@body = @tableHTML,
@body_format = 'HTML',
@exclude_query_output = 1,
@execute_query_database = @db


Cheers

rajani
Constraint Violating Yak Guru

367 Posts

Posted - 2009-10-04 : 19:34:26
ok ,finally found out that these users dont have execute permission on 'sp_send_dbmail', database 'msdb'. whats the best way to fix this ? i know i can give permission to this procedure to this proc but they are many of them . btw these SQL logins not windows logins.

Cheers
Go to Top of Page

stephenbaer
Yak Posting Veteran

71 Posts

Posted - 2009-10-04 : 21:15:15
Put them all in a 'mail' role, then give permissions to the role

----------------
-Stephen
Go to Top of Page
   

- Advertisement -