Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xp_sendmail as different user

Status
Not open for further replies.

b00gieman

Programmer
Jul 9, 2007
60
DE
Hi!

I want to use the xp_sendmail procedure for my database.The problem is I don't have the rights to run the procedure. Instead , I recieved a name that I should run the procedure under.From what I read , I should call the procedure like this:

EXEC master.dbo.xp_sendmail ....@set_user='given_user'

If I run the procedure this way , I get the following error;

EXECUTE permission denied on object 'xp_sendmail', database 'master', owner 'dbo'

Am I doing something wrong?
 
Set user probably won't help as it sets your useid in the current database.

For XP_sendmail to work, your admin will need to give your login execute permission in the master database.

If you are working with sql2005, the server may have it disabled. You should also look at the dbmail feature rather than xp_sendmail which uses MAPI.

For what it is worth

 
I'm using SQL Server 2000.The administartor has granted the permissions for xp_sendmail to a generic user.What I need to do is to impersonate that generic user and send emails.I need to run the xp_sendmail for a database other than the 'master' database.
 
what happens if you just execute it as.

master.dbo.xp_sendmail @Recipients='X@Y.com',@body='Some message'


(body might not be the correcty argument)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top