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


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:


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.


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


  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.


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.


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


  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.


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


  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.


  8. Click Next.


  9. Click Finish.


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


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.


  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.


  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.


  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."