sysadmin denied on sp_send_dbmail

113 views Asked by At

I'm trying to run a SQL Server Agent Job manually but keep getting an error that basically says the domain account is denied on sp_send_dbmail.

The job has multiple steps that run stored procedures. The domain account is sysadmin and it's also the owner of the job. Each step in the job runs as the sysadmin account and my account is also a sysadmin.

It should run under (I assume) sysadmin security context, but I'm lost why it keeps failing.

1

There are 1 answers

3
Royi Namir On

This is not a pure answer but a way to see what's going on :

On the machine that sends mail , please run :

EXEC master..xp_cmdshell 'whoami'

then see who is the user which tries to send mail and grant permission to that user.

Also ,go to the services.msc to your instance , right click , properties and go to logon as and see if that user has permissions.