Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I setup database mail on a SQL Server 2005 instance and kept getting this log message whenever an email was tried:

1) Exception Information

Exception Type: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Data: System.Collections.ListDictionaryInternal
TargetSite: Microsoft.SqlServer.Management.SqlIMail.Server.Objects.AccountGetAccount(Int32)
HelpLink: NULL
Source: DatabaseMailEngine

After checking to make sure my setup was correct, I tried adding the service account user to the sysadmin group, which resolved the problem.

But I'd like to know if that's necessary, or if the particular permissions issue was simply blanketed by the sysadmin role. Is there some more granular permission that I should be using?

share|improve this question

Yes, there is something less drastic than sysadmin!

To use database mail the user must be a user in the msdb database and a member of the DatabaseMailUserRole database role within msdb.

USE msdb
EXEC sp_addrolemember @rolename='DatabaseMailUserRole', @membername='MailUser'
share|improve this answer
Thanks. That was already done, otherwise the mail wouldn't even get queued. The error message in my original post was reported under the service account in the DB Mail log. – Faisal Jul 17 '13 at 17:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.