none
DBMail How to configure without MS Exchange

Odpovědi

  • Hi, Yes MS Exchange exhange can be bypassed for sending dbmail by using any SMTP server that you have access to. Here is a step by step for setting up profile for dbmail, from Dan Guzman's Blog - http://weblogs.sqlteam.com/dang/archive/2009/05/17/Database-Mail-Configuration.aspx . Please do go through the writeup on his blog as well.

    -- Enable Database Mail for this instance

    EXECUTE sp_configure 'show advanced', 1;

    RECONFIGURE;

    EXECUTE sp_configure 'Database Mail XPs',1;

    RECONFIGURE;

    GO

    -- Create a Database Mail account

    EXECUTE msdb.dbo.sysmail_add_account_sp

        @account_name = 'Primary Account',

        @description = 'Account used by all mail profiles.',

        @email_address = 'myaddress@mydomain.com',

        @replyto_address = 'myaddress@mydomain.com',

        @display_name = 'Database Mail',

        @mailserver_name = 'mail.mydomain.com';

    -- Create a Database Mail profile

    EXECUTE msdb.dbo.sysmail_add_profile_sp

        @profile_name = 'Default Public Profile',

        @description = 'Default public profile for all users';

    -- Add the account to the profile

    EXECUTE msdb.dbo.sysmail_add_profileaccount_sp

        @profile_name = 'Default Public Profile',

        @account_name = 'Primary Account',

        @sequence_number = 1;

    -- Grant access to the profile to all msdb database users

    EXECUTE msdb.dbo.sysmail_add_principalprofile_sp

        @profile_name = 'Default Public Profile',

        @principal_name = 'public',

        @is_default = 1;

    GO

    --send a test email

    EXECUTE msdb.dbo.sp_send_dbmail

        @subject = 'Test Database Mail Message',

        @recipients = 'testaddress@mydomain.com',

        @query = 'SELECT @@SERVERNAME';

    GO


    Sanil Mhatre | Database Developer | MCTS | If you find my reply useful in any way, please vote it as helpful. If it has helped answer your question, please mark it as Answer. http://sqlwithsanil.com

    30. dubna 2012 20:14

Všechny reakce

  • Database Mail does not require an exchange account.  You define your smtp server in the configuration wizard

    http://msdn.microsoft.com/en-us/library/ms175951(v=sql.105).aspx


    Chuck

    30. dubna 2012 18:27
  • Hi, Yes MS Exchange exhange can be bypassed for sending dbmail by using any SMTP server that you have access to. Here is a step by step for setting up profile for dbmail, from Dan Guzman's Blog - http://weblogs.sqlteam.com/dang/archive/2009/05/17/Database-Mail-Configuration.aspx . Please do go through the writeup on his blog as well.

    -- Enable Database Mail for this instance

    EXECUTE sp_configure 'show advanced', 1;

    RECONFIGURE;

    EXECUTE sp_configure 'Database Mail XPs',1;

    RECONFIGURE;

    GO

    -- Create a Database Mail account

    EXECUTE msdb.dbo.sysmail_add_account_sp

        @account_name = 'Primary Account',

        @description = 'Account used by all mail profiles.',

        @email_address = 'myaddress@mydomain.com',

        @replyto_address = 'myaddress@mydomain.com',

        @display_name = 'Database Mail',

        @mailserver_name = 'mail.mydomain.com';

    -- Create a Database Mail profile

    EXECUTE msdb.dbo.sysmail_add_profile_sp

        @profile_name = 'Default Public Profile',

        @description = 'Default public profile for all users';

    -- Add the account to the profile

    EXECUTE msdb.dbo.sysmail_add_profileaccount_sp

        @profile_name = 'Default Public Profile',

        @account_name = 'Primary Account',

        @sequence_number = 1;

    -- Grant access to the profile to all msdb database users

    EXECUTE msdb.dbo.sysmail_add_principalprofile_sp

        @profile_name = 'Default Public Profile',

        @principal_name = 'public',

        @is_default = 1;

    GO

    --send a test email

    EXECUTE msdb.dbo.sp_send_dbmail

        @subject = 'Test Database Mail Message',

        @recipients = 'testaddress@mydomain.com',

        @query = 'SELECT @@SERVERNAME';

    GO


    Sanil Mhatre | Database Developer | MCTS | If you find my reply useful in any way, please vote it as helpful. If it has helped answer your question, please mark it as Answer. http://sqlwithsanil.com

    30. dubna 2012 20:14