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!

SQL 2005 Db Mail - Sending Attachment Privileges

Status
Not open for further replies.

zionman4

Programmer
Mar 12, 2003
48
0
0
US
Hi All,
I have setup the database mail for users to send emails without problems. Now the need is to also have it send attachments. I have setup a user account with the specified rights to the network folder where the attachments are located.

I am able to send the attachments w/o problems since I'm part of the sysadmin. Users are not able to send attachments by just adding them to the DatabaseMailUserRole on the msdb database. They get the following error when trying to send the attachment:
"Failed to open attachment N'\\mynetwork\folder\test.doc'. Access Denied. Severity 16."
All users have access to the network folder as well. When I tested it by adding one of the users to the sysadmin, she was able to execute the procedure w/o problems.

Can anyone tell me what privileges I would need to give users for them to be able to send email attachments via sql? I have tried just about everything.

Here is the sp I trigger for sending the emails:

EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'MyProfile',
@recipients = 'john.d@myemail.com',
@subject = 'SQL Mail',
@body = 'Test',
@IMPORTANCE = 'HIGH',
@file_attachments = N'\\mynetwork\folder\test.doc';

Any help would be greatly appreciated!

JP
 
Just a hunch but have you granted exec right to the msdb.dbo.sp_send_dbmail stored procedure for the needed users?

Thanks

J. Kusch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top