How to Use SQL Mail in MS SQL Server 7.0 with MS Outlook and MS Exchange Server

Updated : June 9, 2001

Stephen Dybing

Microsoft SQL Server Support
Published February 1999

Overview

This document describes how to set up Microsoft® SQL Server™ 7.0 to use SQL Mail with a Microsoft® Outlook® client and Microsoft® Exchange Server. It assumes that you have already performed a Typical installation of SQL Server, installed a Microsoft Outlook client on the SQL Server, and have a Microsoft Exchange Server computer installed somewhere on your network.

To set up SQL Mail, you need to perform the following steps:

  1. Set up an e-mail account and a profile on the SQL Server.

  2. Configure SQL Mail.

  3. Test it.

In this document, we will use ServiceAccount as both the account under which SQL Server is running and as the name of the Outlook profile. Substitute your own names in the examples below.

Create the E-mail Account

First, have your Microsoft Exchange Server administrator create an e-mail account for the SQL Server service account. You designated the service account during SQL Server installation in the following dialog box:

Cc917534.70mail01(en-us,TechNet.10).gif

If you do not know the name of the service account, you can find the name by following these steps:

  1. Click Start, point to Programs, point to Microsoft SQL Server 7.0, and then click Enterprise Manager.

    Cc917534.70mail02(en-us,TechNet.10).gif

  2. Expand Microsoft SQL Servers and then expand SQL Server Group.

    Cc917534.70mail03(en-us,TechNet.10).gif

  3. Right-click ServerName, click Properties, and then click the Security tab. The information you need is under Startup service account in the This account text box.

    Cc917534.70mail04(en-us,TechNet.10).gif

Create the Outlook Profile

Next, create an Outlook profile on the SQL Server computer that will be used by the service account. To configure the Outlook profile, follow these steps:

  1. Log on to the SQL Server computer using the service account.

    Warning: Failure to be logged on as the service account will result in MAPI logon failure and consequently will cause SQL Mail to fail.

  2. Click Start, point to Settings, and click Control Panel. Double-click the Mail icon.

  3. Click Add.

    Cc917534.70mail05(en-us,TechNet.10).gif

  4. Select the Microsoft Exchange Server check box and click Next.

    Cc917534.70mail06(en-us,TechNet.10).gif

  5. Type the Exchange Server name in the Microsoft Exchange server text box. Note that the Mailbox text box should be filled in automatically with the ServiceAccount name. Click Next.

    Cc917534.70mail07(en-us,TechNet.10).gif

  6. If it is not already selected, click No, and then click Next.

    Cc917534.70mail08(en-us,TechNet.10).gif

  7. Type the path and name of your Personal Address Book or use the default provided, and then click Next. Microsoft recommends that this information be stored in the Windows NT profiles directory; for example, C:\Winnt\Profiles\ServiceAccount. This will help to prevent the file from being accidentally overwritten.

    Cc917534.70mail09(en-us,TechNet.10).gif

  8. Click Next.

    Cc917534.70mail10(en-us,TechNet.10).gif

  9. Click Finish.

    Cc917534.70mail11(en-us,TechNet.10).gif

  10. The service account profile has now been created. Test it by starting the Outlook client and sending a message to yourself.

    Cc917534.70mail12(en-us,TechNet.10).gif

Configure SQL Mail

Next, configure SQL Mail. To do this, follow these steps:

  1. Go back to SQL Server Enterprise Manager, expand your server, and then expand Support Services.

    Cc917534.70mail13(en-us,TechNet.10).gif

  2. Right-click SQL Mail and click Properties. In the Profile name list, select the profile you created above. Click the Autostart SQL Mail when SQL Server starts check box, and then click OK.

    Cc917534.70mail14(en-us,TechNet.10).gif

  3. Right-click SQL Mail and click Start.

    Caution: If SQL Mail does not start at this point, check the SQL Server error log for errors.

Verify That SQL Mail Works

Finally, test your ability to send mail using the xp_sendmail extended stored procedure. To do this, follow these steps:

  1. Start (or switch to) Enterprise Manager.

  2. On the Tools menu, click SQL Server Query Analyzer to start the Query Analyzer.

  3. Type the query that appears below and execute it.

    Cc917534.70mail15(en-us,TechNet.10).gif

  4. Start your Outlook client and verify that the message was received.

If these procedures worked correctly, you can successfully use SQL Mail with a Microsoft Outlook client and Microsoft Exchange Server.

If the procedures did not work correctly and you are unable to use SQL Mail, you can find troubleshooting tips in the Microsoft Knowledge Base article 153159, "INF: Troubleshooting SQLMail with Microsoft Exchange Server."