I can''t get database mail to work ;-((

  • Hi all

    I've been messing around with this for two days now

    I've setup mail as per several web sites that I looked at as per:

    ------------------------------ STEP 1

    use master

    go

    sp_configure 'show advanced options',1

    go

    reconfigure with override

    go

    sp_configure 'Database Mail XPs',1

    --go

    --sp_configure 'SQL Mail XPs',0

    go

    reconfigure

    go

    -------------------------------------- STEP 2

    EXECUTE msdb.dbo.sysmail_add_account_sp

    @account_name = 'Ford',

    @description = 'Mail account for Database Mail',

    @email_address = 'bill.dillon@columbiaultimate.com',

    @display_name = 'Ford',

    @username='bill.dillon@columbiaultimate.com',

    @password='dillon4',

    @mailserver_name = 'exch1-wa.cunet.local'

    --------------------------------------- STEP 3

    EXECUTE msdb.dbo.sysmail_add_profile_sp

    @profile_name = 'Ford',

    @description = 'Profile used for database mail'

    ---------------------------------------- STEP 4

    EXECUTE msdb.dbo.sysmail_add_profileaccount_sp

    @profile_name = 'Ford',

    @account_name = 'Ford',

    @sequence_number = 1

    ---------------------------------------- STEP 5

    EXECUTE msdb.dbo.sysmail_add_principalprofile_sp

    @profile_name = 'Ford',

    @principal_name = 'public',

    @is_default = 1 ;

    ----------------------------------------- STEP 6

    declare @body1 varchar(100)

    set @body1 = 'Server :'+@@servername+ ' My First Database Email '

    EXEC msdb.dbo.sp_send_dbmail @recipients='bill.dillon@columbiaultimate.com',

    @subject = 'My Mail Test',

    @body = @body1,

    @body_format = 'HTML' ;

    ------------------------------------------- STEP 7

    --- Check GUI configuration

    ------------------------------------------- STEP 8

    SELECT * FROM msdb.dbo.sysmail_event_log

    Now when I created a job that would fail, I set the notification to email. In the job log it says that the notification was sent.

    however in the susmail_event_log, I get this message:

    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 7 (2007-04-05T15:40:01). Exception Message: Cannot send mails to mail server. (The specified string is not in the form required for an e-mail address.). )

    Even though my test mail comes through fine using:

    declare @body1 varchar(100)

    set @body1 = 'Server :'+@@servername+ ' My First Database Email '

    EXEC msdb.dbo.sp_send_dbmail @recipients='bill.dillon@columbiaultimate.com',

    @subject = 'My Mail Test',

    @body = @body1,

    @body_format = 'HTML' ;

    Please help before I shot myself ;-))

    Thanks

    Bill

  • the first thing that pops in my head is can the database server relay email through the mail server (assuming you are using exchange).

  • We are using exchang and as far as I know SMTP is enabled on default port.

    Bill

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply