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 = 'email@example.com', @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?