Using sp_send_dbmail with SQL authentication to send attachments from UNC path
0
votes
1
answer
1773
views
I'm trying to send emails with attachments using a SQL authentication account that I have granted credentials to.
The login used in the stored Credentials is a domain account that has permissions to read from the share.
EXEC msdb.dbo.sp_send_dbmail
@recipients = 'me@abc.xyz.nz',
@profile_name = 'Alarms',
@subject = 'Test with Attachment',
@body = '*** Alarms ***' ,
@file_attachments = '\\Servername\Share\Images\TestImage.png'
But when I use the SQL login I get the following error:
> Msg 22051, Level 16, State 1, Line 26 The client connection security
> context could not be impersonated. Attaching files require an
> integrated client login
What have I missed? how can I test that the credentials have been applied correctly? Does this only work for a local share?
Edit: I granted my SQL login Sysadmin privs and it now works with both a local share and with a remote share. So what privs does sysadmin have that allows this to work?
Asked by Sir Swears-a-lot
(3253 rep)
Aug 29, 2018, 04:45 AM
Last activity: Sep 3, 2018, 08:24 PM
Last activity: Sep 3, 2018, 08:24 PM