Database Mail Setup Guidelines August 2015 Delivering the Moment
Publication Information 2015 Imagine Communications Corp. Proprietary and Confidential. Imagine Communications considers this document and its contents to be proprietary and confidential. Except for making a reasonable number of copies for your own internal use, you may not reproduce this publication, or any part thereof, in any form, by any method, for any purpose, or in any language other than English without the written consent of Imagine Communications. All others uses are illegal. This publication is designed to assist in the use of the product as it exists on the date of publication of this manual, and may not reflect the product at the current time or an unknown time in the future. This publication does not in any way warrant description accuracy or guarantee the use for the product to which it refers. Imagine Communications reserves the right, without notice to make such changes in equipment, design, specifications, components, or documentation as progress may warrant to improve the performance of the product. Trademarks Product names and other brands are trademarks or trade names of Imagine Communications or its subsidiaries. Microsoft and Windows are registered trademarks of Microsoft Corporation. All other trademarks and trade names are the property of their respective companies Contact Information Imagine Communications has office locations around the world. For locations and contact information see: http://www.imaginecommunications.com/contact-us/. Support Contact Information For support contact information see: Support Contacts: http://www.imaginecommunications.com/services/technical-support/ ecustomer Portal: http://support.imaginecommunications.com 2015 Imagine Corporations Corp. Proprietary and Confidential
Database Mail Configuration Process Table of Contents Table of Contents Purpose... 4 Guidelines for SQL Server 2005/2008... 4 Steps to configure database mail... 4 Create SQL Server Job...13 Adjust the properties within the SQL Server Agent...14 Create an Operator...15 2015 Imagine Corporations Corp. Proprietary and Confidential Page i of 17
Purpose This document is intended to be a basic guide for setting up a Database mail in order to send notifications in case of SQL Agent job failures. Guidelines for SQL Server 2005/2008 Steps to configure database mail Given below are the steps to configure database mail: 1. Open SQL Server Management Studio (SSMS), connect to the Database Engine, expand Management, right-click on Database Mail and then click Configure Database Mail. 2015 Imagine Corporations Corp. Proprietary and Confidential Page 4 of 17
2. In the Welcome to Database Mail Configuration Wizard screen, click Next 3. Leave the default option of Set up Database Mail by performing the following tasks selected. Click Next. 2015 Imagine Corporations Corp. Proprietary and Confidential Page 5 of 17
4. You will get a pop-up below if mail has not been configured yet. Click Yes and then click Next. 2015 Imagine Corporations Corp. Proprietary and Confidential Page 6 of 17
5. Give the New Profile a name and then click Add. 2015 Imagine Corporations Corp. Proprietary and Confidential Page 7 of 17
6. Fill in the correct information as show below: Email address This should be the sender email address. Display name Type the name to show on e-mail messages sent from this account. The display name is optional. Reply e-mail Type the e-mail address that will be used for replies to e-mail messages sent from this account. The reply e-mail is optional. For example, replies to an account for SQL Server Agent may go to the database administrator. Server name Type the name or IP address of the SMTP server the account uses to send e-mail. Typically this is in a format similar to smtp.<your_company>.com. For help with this, consult your mail administrator. Port number Type the port number of the SMTP server for this account. Most SMTP servers use port 25. SMTP Authentication Leave this section set to the default, but you can specify it to your needs if it is required. Note: The OK button will remain grayed out until all required fields are completed. Once all the required fields are completed, click OK. 2015 Imagine Corporations Corp. Proprietary and Confidential Page 8 of 17
7. Click Next. 2015 Imagine Corporations Corp. Proprietary and Confidential Page 9 of 17
8. Check the option to make the new profile Public. 2015 Imagine Corporations Corp. Proprietary and Confidential Page 10 of 17
9. Review the System Parameters. Click Next. 2015 Imagine Corporations Corp. Proprietary and Confidential Page 11 of 17
10. Click Finish. 11. You should see that each Action was completed and has a Status of Success. Click Close. 2015 Imagine Corporations Corp. Proprietary and Confidential Page 12 of 17
Database Mail Configuration Process Create SQL Server Job 12. Right-click Database Mail and select Send Test E-Mail type in an email address to use for testing and click Send Test E-Mail. 13. You will then see the screen below. If the email doesn t arrive, check the mail server to make sure it is properly configured and will accept mail from the SQL Server. Create SQL Server Job 2015 Imagine Corporations Corp. Proprietary and Confidential Page 13 of 17
Database Mail Configuration Process Create SQL Server Job At this point we know the SQL Server can send email. Now we need to setup a SQL Job and then set SQL so it sends emails if the job fails. Adjust the properties within the SQL Server Agent 1. Right-click SQL Server Agent and select Properties. 2015 Imagine Corporations Corp. Proprietary and Confidential Page 14 of 17
Database Mail Configuration Process Create SQL Server Job 2. Click on Alert System under Select a page. Then, under Mail session, select the option to Enable mail profile. Ensure the correct Mail profile is selected. Click OK. 3. Restart the SQL Server Agent service. Create an Operator 2015 Imagine Corporations Corp. Proprietary and Confidential Page 15 of 17
Database Mail Configuration Process Create SQL Server Job 1. Under the SQL Server Agent, right-click Operators and select New Operator 2. Type in the recipient Name and email address in the E-mail name and click OK. 3. Expand SQL Server Agent and click on Jobs. Right click on the job you want to send mail for in case of failure and select Properties. 4. Under Select a page, select Notifications. Enable the first option, E-mail. Then select the Operator we just created and change the job to email When the job fails. Click OK. 2015 Imagine Corporations Corp. Proprietary and Confidential Page 16 of 17
Database Mail Configuration Process Create SQL Server Job You should receive an email similar to the one below if the job fails: 2015 Imagine Corporations Corp. Proprietary and Confidential Page 17 of 17