Manually adding a mail account to SQL2005/2008

I was having trouble adding configuring Database Mail on a SQL2005 server today.
I followed the wizard just like I had done on the previous 6 servers, but this one just didn’t want to add it. It was giving me an error about not being able to insert a NULL into the server name field, although I was giving it a server name.

I tried manually adding the data into the table, but of course that didn’t work. You have to use a stored procedure.
You need to use msdb.dbo.sysmail_add_account_sp with options like below,

msdb.dbo.sysmail_add_account_sp @account_name='company.com mail server',@email_address='john.doe@company.com',@display_name='John Doe',@replyto_address='john.doe@company.com',@mailserver_name='mail.company.com',@port=25;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s