I set up email notification for a job completes. I configured database mail profile and mail account. This works fine and I can send out test email.
However, the SQL agent couldn't send out email and when I tried to restart the SQL server agent, I got the following errors:
Message
[260] Unable to start mail session (reason: Microsoft.SqlServer.Management.SqlIMail.Server.Common.BaseException: Mail configuration information could not be read from the database. ---> System.InvalidCastException: Unable to cast object of type 'System.DBNull'
to type 'System.Byte[]'.
at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.DataAccessAdapter.GetAccount(Int32 accountID)
--- End of inner exception stack trace ---
at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.DataAccessAdapter.GetAccount(Int32 accountID)
)
My SQL server is SQL 2008 with service pack 3.
Anybody has any idea what's the problem is?
Thanks