I have a stored procedure in msdb that basically wraps sp_send_dbmail and then I grant execute to my procedure to a specific user.
I can run this "wrapper" procedure just fine when connected as my windows account, but then again I am in the sysadmin role.
When connected as the user who has been grated exec permissions, I get something like this
Msg 15404, Level 16, State 10, Procedure xp_logininfo, Line 62
Could not obtain information about Windows NT group/user
(user name here...) error code 0xffff0002
Requires membership in the sysadmin fixed server role or membership in the
public fixed database role in the
master database with EXECUTE permission granted.
You can use EXECUTE AS in msdb database and grant exec permission to user.
CREATE PROCEDURE dbo.WWW
WITH EXECUTE AS OWNER
Please verify that you database mail profile is public. It should to be public or set to private for the user that is going to access it.
The following thread is about similar issue, please see:
Reference:grant access to profiles
TechNet Community Support
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.
Would you like to participate?