how can i install and configure smtp server/services

  • Hi

    how can i install and configure smtp server/services.

    i installed only sql server 2012 software.

    am i need to install windows server 2012.

    can any one suggest me.

  • SMTP servers are separate software. This isn't included with SQL Server. Your Exchange or other mail server can function as an SMTP server.

  • what want to achive, you want to install SMTP server ? or SQL server.

    or you want to use your smtp server to send out email from sql server ??

  • Hi

    yes i want to use smtp server to send out email from sql server ??

  • The basic code to do this is:

    USE master;

    EXEC sp_configure 'Database Mail XPs', 1;

    RECONFIGURE WITH OVERRIDE;

    --Create a new mail profile

    USE msdb;

    EXEC msdb.dbo.sysmail_add_profile_sp @profile_name = '<<profilename>>',

    @description = '<<profiledescription>>';

    EXEC msdb.dbo.sysmail_add_account_sp @account_name = '<<accountname>>',

    @description = '<<accountdescription>>',

    @email_address = '<<accountemailaddress>>',

    @display_name = '<<accountdisplayname>>',

    @replyto_address = '<<replytoaddress>>',

    @mailserver_name = '<<smtpservername>>', @username = '<<smtpusername>>',

    @password = '<<smtppassword>>', @port = 25;

    -- assuming default

    EXEC msdb.dbo.sysmail_add_profileaccount_sp @profile_name = '<<profilename>>',

    @account_name = '<<accountname>>', @sequence_number = 1;

    You might then want to associate the profile with the SQL Agent so you can set it up for notifications:

    EXEC msdb.dbo.sp_set_sqlagent_properties @databasemail_profile = '<<profilename>>';

    EXEC msdb.dbo.sp_add_operator @name = '<<OperatorName>>', @enabled = 1,

    @pager_days = 0, @email_address = '<<operatoremailaddress>>';

    You might then want to set this as your failsafe email operator for Agent:

    USE [msdb];

    EXEC master.dbo.sp_MSsetalertinfo @failsafeoperator=N'<<operatorname>>', @notificationmethod=1;

    USE [msdb];

    EXEC msdb.dbo.sp_set_sqlagent_properties @email_save_in_sent_folder=1, @databasemail_profile=N'<<profilename>>', @use_databasemail=1;

    If you do all that, then there's no excuse for not setting up the appropriate email alerts too...

    Thomas Rushton
    blog: https://thelonedba.wordpress.com

  • Hi

    i tried this but its giving the error like this

    Msg 15123, Level 16, State 1, Procedure sp_configure, Line 62

    The configuration option 'Database Mail XPs' does not exist, or it may be an advanced option.

  • First, is this SQL Server 2012?

    Second, this might help you get started: http://www.sqlservercentral.com/articles/Stairway+Series/72455/

  • you need to run the following in order to see the advanced options

    EXEC sp_configure 'Show Advanced Options',1

    RECONFIGURE

  • Hi

    yes it is the sql server 2012.

    i have done all the things still mail is not sending the status is failed its saying.

    i uploaded the screen... please suggest the solution

  • naveenareddy.dba (6/10/2016)


    Hi

    yes it is the sql server 2012.

    i have done all the things still mail is not sending the status is failed its saying.

    i uploaded the screen... please suggest the solution

    Your screenshot is not visible to me (the page won't load). Could you describe the problem you're having?

    And did you restart SQL Server Agent Service after enabling Database Mail?

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • naveenareddy.dba (6/9/2016)


    Hi

    i tried this but its giving the error like this

    Msg 15123, Level 16, State 1, Procedure sp_configure, Line 62

    The configuration option 'Database Mail XPs' does not exist, or it may be an advanced option.

    See below:

    subramanian.esakkimuthu 40485 (6/10/2016)


    you need to run the following in order to see the advanced options

    EXEC sp_configure 'Show Advanced Options',1

    RECONFIGURE

    And if that doesn't work, change the code to:

    sp_configure 'show advanced options', '1';

    RECONFIGURE WITH OVERRIDE;

    GO

    Then run this again:

    USE master;

    EXEC sp_configure 'Database Mail XPs', 1;

    RECONFIGURE;

    Double check your profiles are set up and that an account is set up using your default profile. Then restart the SQL Server Agent Service.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • You uploaded a Word backup file, which isn't valid. It would be better to send an image screenshot, or post it elsewhere and link here.

    Brandie has given you some things to check. Make sure your credentials for SMTP are valid . You can add another mail profile in Outlook or your mail client to check them.

  • we cannot see the attach document , so attached the screen shot

  • hi

    i am getting the error like this

    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1007 (2016-06-11T23:01:39). Exception Message: Cannot send mails to mail server. (The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at).

  • hi

    i have entered all the valid details,

    enabled service broker,enabled mail in agent server and restarted,i have made Database Mail XPs run value 1,

    smtp server:smtp.gmail.com

    port:587

    when ever i sent the test mail. then i am getting the error like this

    The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1007 (2016-06-11T23:01:39). Exception Message: Cannot send mails to mail server. (The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at).

    shall any one help me to solve this issue please.

Viewing 15 posts - 1 through 15 (of 21 total)

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