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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database Mail

Status
Not open for further replies.

bikerboy718

Programmer
Feb 11, 2005
195
US
I am having an issue running the sp_send_dbmail from a non sysadmin account. I am running SQL Server 2008 R2 SP1. I gave the user permissions to the DatabaseMailUserRole under the msdb database however anytime I try to run the sp_send_dbmail I get the following error message:

Msg 14607, Level 16, State 1, Procedure sp_send_dbmail, Line 141
profile name is not valid

When I run the same command under a sysadmin account it runs with no problem. I am cutting and pasting the code. The code that I am sending is as follows:

Code:
EXEC msdb.dbo.sp_send_dbmail   
	@profile_name = 'Desktop',   
	@recipients = 'me@me.com',    
	@subject = 'Test',   
	@body  = 'Message',     @body_format = 'HTML';

Is there something that I am missing?

Any help would be greatly appreciated.

With Great Power Comes Great Responsibility!!! [afro]

Michael
 
I actually figured this one out. I had 2 instances of management studio open and somehow not all of the settings took when I was executing the sp_send_dbmail under the non SysAdmin user between instances.

With Great Power Comes Great Responsibility!!! [afro]

Michael
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top