Sunday, February 19, 2012

DATABASE Mail Account Setup Error

When I attempt to setup a new Mail Account using the GUI I receive error:
Cannot insert the value NULL into 'servername', table
'msdb.dbo.sysmail_server'
column does not allow Nulls.
I feel in all the fields on the Account Setup Screen and put in a valid smtp
server name or the IP. Then it fails. If i run the stored proc that sets up
the account, sysmail_add_account_sp, it works. After I run the sp I go into
the modify the account and it looks just like it did when I ran the GUI.
I am running 2005 on a virtual server.
Any help would be appreciated.
On Mar 15, 1:50 pm, Thom <T...@.discussions.microsoft.com> wrote:
> When I attempt to setup a new Mail Account using the GUI I receive error:CannotinsertthevalueNULLinto'servername',tab le
> 'msdb.dbo.sysmail_server'columndoes not allow Nulls.
> I feel in all the fields on the Account Setup Screen and put in a valid smtp
> server name or the IP. Then it fails. If i run the stored proc that sets up
> the account, sysmail_add_account_sp, it works. After I run the sp I gointo
> the modify the account and it looks just like it did when I ran the GUI.
> I am running 2005 on a virtual server.
> Any help would be appreciated.
Don't use the wizard. I was having the same problem and ended up
scripting it out instead:
from: http://www.sql-server-performance.com/da_email_functionality.asp
EXECUTE msdb.dbo.sysmail_add_account_sp
@.account_name = 'Dinesh',
@.description = 'Dinesh Mail on dynanet.',
@.email_address = 'dinesh@.dynanet.com',
@.display_name = 'Dinesh Asanka',
@.mailserver_name = 'mail.dynanet.com'
Use the sysmail_add_profile procedure to create a Database Mail
profile called Dinesh Mail Profile:
EXECUTE msdb.dbo.sysmail_add_profile_sp
@.profile_name = 'Dinesh',
@.description = 'Dinesh Profile'
User the sysmail_add_profileaccount procedure to add the Database Mail
account and Database Mail profile you created in previous steps.
EXECUTE msdb.dbo.sysmail_add_profileaccount_sp
@.profile_name = 'Dinesh',
@.account_name = 'Dinesh',
@.sequence_number = 1
Use the sysmail_add_principalprofile procedure to grant the Database
Mail profile access to the msdb public database role and to make the
profile the default Database Mail profile:
EXECUTE msdb.dbo.sysmail_add_principalprofile_sp
@.profile_name = 'Dinesh',
@.principal_name = 'public',
@.is_default = 1 ;

No comments:

Post a Comment