Free Newsletters:
DatabaseDaily  
Database Journal
Search Database Journal:
 
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Links Database Forum DBA Videos
internet.com

» Database Journal Home
» DBA Videos
» Database Articles
» Database Tutorials
MS SQL
Oracle
MS Access
MySQL
DB2
» RESOURCES
Database Tools
SQL Scripts & Samples
Links
» Database Forum
» DBA Jobs
» Sitemap

News Via RSS Feed



follow us on Twitter

Marketplace Partners
Be a Marketplace Partner

internet.commerce
Be a Commerce Partner


















eBay Sees Strong Quarter on PayPal Growth

Mozilla Patches 14 Firefox Security Flaws

Juniper Sees Lift From Carriers, Enterprise IT

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Database Journal | DBA Support | SQLCourse | SQLCourse2









Software Lead – C#, .Net - INTERVIEW NOW! (IL)
Next Step Systems
US-IL-Libertyville

Justtechjobs.com Post A Job | Post A Resume

Featured Database Articles

MS SQL

October 22, 2004

Automate with SQL Mail

By Steven Warren

As a database administrator, I like automation. When it comes to my backups, I like to automate as much as possible. SQL Mail gives me the ability to know when my backups are successful and when they fail.

SQL Mail is a component of SQL Server that allows you to send mail. Some of its functions include the ability to send messages to an e-mail pager and to send results via the extended stored procedure (xp_sendmail).

SQL Mail allows you to send and receive e-mail by working side by side with a mail server. There are two services that handle SQL Mail with SQL Server 2000: MSSQLServer and SQLServerAgent. I am going to explain how to configure and take advantage of this hidden gem.

Setup

Before you configure SQL Mail, you will need to configure a mailbox, mail profile, and a Windows 2000 account to start SQL Server. If you are using Exchange, you need a domain account. If you are using a basic POP3/SMTP mail server, you need a local or domain account. For the purposes of this article, I will show you how to configure a POP3/SMTP mail server.

You will begin by creating an account on your domain that will be used to configure SQL Mail, as shown in Figure A.

Figure A

Set up a service account for SQL Mail.

Next, you need to log in to Windows with the newly created account. Once you are logged in, your next step is to start your MSSQLServer service and SQLServerAgent service.

In order to configure your MSSQLServer account to run under this newly created account, open Enterprise Manager from Start | Programs | Microsoft SQL Server | Enterprise Manager. Next, right-click on your SQL Server and choose Properties, as shown in Figure B, then choose the Security tab. Under the Startup Service Account, choose This Account and type the name of the account you created for use with SQL Mail.

Figure B

Set up MSSQLServer to run under the service account.

Now that you have configured the MSSQLServer service account, you will need to configure the SQLServerAgent service account. In order to do this, expand SQL Server and Management, then right-click on SQL Server Agent and choose Properties (Figure C). On the General Page, enter the Service Startup Account by choosing This Account and enter the account name and password you created to start your SQLServerAgent service.

Figure C

Set up SQLServerAgent to run under the service account.

Configure the Outlook Client

In order to configure your Microsoft Outlook client, you first need to make sure you have Microsoft Outlook installed. You can install this client from the Microsoft Office CD. Once you have it installed, click Control Panel from the Start Menu, then double-click the Mail icon, as shown in Figure D.

Figure D

You are now ready to configure a mail account.

Next, click Show Profiles, and then click Add, to add a new profile, as shown in Figure E.

Figure E

Configure your mail profile.

You will now be prompted with a wizard to add a new e-mail account, as shown in Figure F. Once you complete this step with the appropriate information, you are ready to configure SQL Mail.

Figure F

Use Outlook to set up the actual mail account.



Go to page: 1  2  Next  

Tools:
Add databasejournal.com to your favorites
Add databasejournal.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed

MS SQL Archives








Latest Forum Threads
MS SQL Forum
Topic By Replies Updated
Writing dynamic sql to txt file ssingh 1 July 14th, 06:25 PM
Email Script kappa02 1 July 10th, 07:51 PM
Impersonate to Create Database cuctitanium 2 July 8th, 12:34 PM
Incremental Loading of Data Ninel 0 July 7th, 12:23 PM