Sql-server – Minimum permissions required for mail attachment in DbMail

database-mailsql serversql server 2014

I know that SQL DbMail requires for attaching, a windows login or a sysadmin privilege is required.

This is somewhat similar to minimum dbMail permissions which was asked by me at an earlier point.

I want to understand whether without sysadmin what is the minimum privilege required for attaching files.

Best Answer

As seen in the TechNet article on sp_send_dbmail:

Execute permissions for sp_send_dbmail default to all members of the DatabaseMailUser database role in the msdb database. However, when the user sending the message does not have permission to use the profile for the request, sp_send_dbmail returns an error and does not send the message.

As for attachments, the SQL Server service account (the actual Windows/AD account that the SQL Server process runs on) is also going to need read access to the actual folder where the file is stored.