Occasional error: Could not obtain information about Windows NT group/user 'domain\user', error code 0x54b
I would strongly advise against using sysadmin privileges to simply send an email... have you ever hear of the principle of least privilege!? This wouldn't solve your problem, just provide a work around! Similarly, you would be enabling the login to drop databases, change passwords, and create all sorts of chaos!

Have you checked the SQL error logs, or the event logs. It may also be a good idea to check the logs on your DC, to see if there is any information there.

Are you having any problems with the account that the agent job is being execute as? Presumably this has the appropriate permissions for what you are asking? when you are executing the script you are executing it under your context, not the context of the agent. This is likely why it works for you all the time.

Without any additional information, preferably from your logs, it's difficult to help any better than this