• we have office365, so i just setup and tested a dbmail using it;

    here's the scripted results, which will probably help you a lot:

    i was in a rush, and named both the account and the profile the same name, i hope that's not too confusing.

    --#################################################################################################

    -- BEGIN Mail Settings outlook.office365.com

    --#################################################################################################

    IF NOT EXISTS(SELECT * FROM msdb.dbo.sysmail_profile WHERE name = 'outlook.office365.com')

    BEGIN

    --CREATE Profile [outlook.office365.com]

    EXECUTE msdb.dbo.sysmail_add_profile_sp

    @profile_name = 'outlook.office365.com',

    @description = 'outlook.office365.com';

    END --IF EXISTS profile

    IF NOT EXISTS(SELECT * FROM msdb.dbo.sysmail_account WHERE name = 'outlook.office365.com')

    BEGIN

    --CREATE Account [outlook.office365.com]

    EXECUTE msdb.dbo.sysmail_add_account_sp

    @account_name = 'outlook.office365.com',

    @email_address = 'lowell@mycompanydomain.com',

    @display_name = 'Lowell',

    @replyto_address = '',

    @description = 'outlook.office365.com',

    @mailserver_name = 'outlook.office365.com',

    @mailserver_type = 'SMTP',

    @port = '587',

    @username = 'lowell@mycompanydomain.com',

    @password = 'NotTheRealPassword',

    @use_default_credentials = 0 ,

    @enable_ssl = 1 ;

    END --IF EXISTS account

    IF NOT EXISTS(SELECT *

    FROM msdb.dbo.sysmail_profileaccount pa

    INNER JOIN msdb.dbo.sysmail_profile p ON pa.profile_id = p.profile_id

    INNER JOIN msdb.dbo.sysmail_account a ON pa.account_id = a.account_id

    WHERE p.name = 'outlook.office365.com'

    AND a.name = 'outlook.office365.com')

    BEGIN

    -- Associate Account [outlook.office365.com] to Profile [outlook.office365.com]

    EXECUTE msdb.dbo.sysmail_add_profileaccount_sp

    @profile_name = 'outlook.office365.com',

    @account_name = 'outlook.office365.com',

    @sequence_number = 1 ;

    END --IF EXISTS associate accounts to profiles

    --#################################################################################################

    -- Drop Settings For outlook.office365.com

    --#################################################################################################

    /*

    IF EXISTS(SELECT *

    FROM msdb.dbo.sysmail_profileaccount pa

    INNER JOIN msdb.dbo.sysmail_profile p ON pa.profile_id = p.profile_id

    INNER JOIN msdb.dbo.sysmail_account a ON pa.account_id = a.account_id

    WHERE p.name = 'outlook.office365.com'

    AND a.name = 'outlook.office365.com')

    BEGIN

    EXECUTE msdb.dbo.sysmail_delete_profileaccount_sp @profile_name = 'outlook.office365.com',@account_name = 'outlook.office365.com'

    END

    IF EXISTS(SELECT * FROM msdb.dbo.sysmail_account WHERE name = 'outlook.office365.com')

    BEGIN

    EXECUTE msdb.dbo.sysmail_delete_account_sp @account_name = 'outlook.office365.com'

    END

    IF EXISTS(SELECT * FROM msdb.dbo.sysmail_profile WHERE name = 'outlook.office365.com')

    BEGIN

    EXECUTE msdb.dbo.sysmail_delete_profile_sp @profile_name = 'outlook.office365.com'

    END

    */

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!