INF: How to Configure SQL Mail
This article was previously published under Q263556 On This PageSUMMARY This article describes how to properly configure your mail
client so that it works with SQL Mail. The article also describes some common
pitfalls that you might encounter when you set up SQL Mail to work with
Exchange or Internet mail servers. Depending on the version of SQL Server you are using, both SQL Mail and SQLAgentMail can connect with Microsoft Exchange Server, Microsoft Windows NT Mail, or a Post Office Protocol 3 (POP3) server . SQL Mail allows SQL Server to send and receive e-mail by establishing a client connection with a supported mail server. For SQL Mail to work properly, you must have a mail account on an available supported mail server and you must have installed and properly configured a SQL Server Mail Application Programming Interface (MAPI)-compliant mail client, such as Microsoft Outlook, Microsoft Exchange Client, or Microsoft Windows Messaging (for Windows NT 4.0) on your SQL Server computer. The SQL Server mail client support depends upon your SQL Server version and the functionality required. SQL Server 6.5 and SQL Server 7.0SQL Mail establishes a simple MAPI connection to Microsoft Exchange Server, Microsoft Windows NT Mail, or a Post Office Protocol 3 (POP3) server.SQL Server 7.0 Using SQLAgentMailSQLAgentMail establishes either a simple or extended MAPI connection to Microsoft Exchange Server, Microsoft Windows NT Mail, or a Post Office Protocol 3 (POP3) server.SQL Server 2000SQL Mail establishes an extended MAPI connection with a mail host, while SQLAgentMail establishes a separate extended MAPI connection. Both SQL Mail and SQLAgentMail can connect with Microsoft Exchange Server, or a Post Office Protocol 3 (POP3) server.NOTE: Due to the limitation of only providing extended MAPI support, SQL Server 2000 requires a Microsoft Outlook 2000 client (or later version). For additional information, click the article number below to view the article in the Microsoft Knowledge Base: 281293 (http://support.microsoft.com/kb/281293/EN-US/) FIX: SQL Mail 2000 Needs Microsoft Outlook 2000 Client
Before you configure SQL Mail, you should test the
mail profile used by the mail client to verify that you can use it to send and
receive e-mail to and from the mail server.WARNING: SQL Mail is not fully supportable when used on a SQL Server Failover Cluster due to the MAPI limitation of not being cluster-aware. If you use SQL Mail with clustering, support provided for SQL Mail is on a "reasonable effort" basis with no guarantees of stability or availability. For additional information, click the article number below to view the article in the Microsoft Knowledge Base: 298723 (http://support.microsoft.com/kb/298723/EN-US/) BUG: SQL Mail Not Fully Supported w/Cluster Virtual SQL Servers
MORE INFORMATIONOverview of SQL MailSQL Mail allows SQL Server to send and receive e-mail by establishing a client connection with a mail server. SQL Server version 6.5 uses a single service to handle mail. SQL Server 7.0 and SQL Server 2000 use two services to handle mail:
SQL Mail and SQLAgentMail establish a MAPI connection with a mail host. Both SQL Mail and SQLAgentMail can connect with Microsoft Exchange Server or a Post Office Protocol 3 (POP3) server. SQLMail and SQLAgentMail for SQL Server 6.5 and SQL Server 7.0 can also connect with Microsoft Windows NT Mail, but this configuration is not supported for SQL Server 2000. Microsoft recommends the use of Exchange Servers for reliability due to the limitations and logon issues of the POP3/SMTP protocols. Microsoft does not support using SQL Mail to communicate with mail servers such as Lotus Notes, Lotus cc:Mail, or Novell GroupWise unless they are treated as POP3 servers. SQL Mail is a mail-enabled application. When you send mail, SQL Mail uses the Mapi32.dll file to make an API call to start the MAPI spooler of the Windows Messaging subsystem (Mapisp32.exe), send the mail, and then shut the spooler down. In older mail clients, the MAPI spooler was not designed to be used with an NT service. With these older MAPI spoolers, outgoing mail generated by SQL Mail remains stuck in the Outbox until the mail client is opened. The problem was fixed in Microsoft Windows NT 4.0 Service Pack 3, but was not incorporated into subsequent NT 4.0 service packs due to product incompatibilities. For additional information, click the article number below to view the article in the Microsoft Knowledge Base: 159425 (http://support.microsoft.com/kb/159425/EN-US/) PRB: Message Blocked with SQLMail and Exchange Client
Several problems with configuring SQL Mail are due
to use of an incorrect Mapi32.dll file.Before You Set Up SQL MailSQL Mail requires a mail connection, a mailbox, a mail profile, and the Windows NT account you used to start SQL Server. This Windows NT account needs to be a domain account if you are using an Exchange server as your mail server. It can be a local or domain NT account if you are using POP3/SMTP mail server.The basic procedure is to log on to your Windows NT server using the account you used to start SQL Server, set up your mail profile, test the mail connection, and then provide this mail profile to SQL Mail. When you choose a profile name, try not to include special characters (such as hyphens, pound signs, periods, and so forth) because they may work with Exchange clients (such as Outlook), but not with the SQL Server 6.5 version of SQL Mail. For the same reason, the profile name cannot be longer than 32 characters. For best results, use Microsoft Exchange Server for sending and receiving SQL Mail. Microsoft Windows NT Mail is a limited mail program that was included with Microsoft Windows NT prior to the release of the full featured mail services provided by the Microsoft Exchange Server product line and cannot be used with SQL Mail 2000. If you are using a third-party mail server (such as Lotus Notes, Lotus cc:Mail, Novell GroupWise, and so forth), you must configure the mail server as a POP3 server. Microsoft does not support connecting to these mail servers using the native mail services that might be installed by the third-party mail client. Some third-party mail clients do not support the MAPI required by SQL Mail. Contact the third-party vendor or refer to the http://www.microsoft.com/exchange/default.mspx (http://www.microsoft.com/exchange/default.mspx) Web site for assistance concerning the use of their mail clients or the availability of a Exchange connector to integrate both Exchange and your current mail service provider. How To Set Up SQL Mail With Exchange
How To Set Up SQL Mail With An Internet Mail ServerWARNING: Unless you can guarantee 100% connectivity to your Internet mail server without the need to reauthenticate your mail logon, SQL Mail can hang, forcing you to stop and restart SQL Server. Use of an Internet mail server is not a recommended solution but may be the only alternative in some cases.The procedure for setting up SQL Mail with an Internet mail server (POP3/SMTP server) is similar to that for setting up SQL Mail with an Exchange Server:
The reason for this is that SQL Mail does not provide for retries when accessing a POP3 account. If SQL Mail cannot connect to the POP3 server on the first attempt, the Internet Mail Connector normally opens a dialog box that prompts you to click OK to retry. It that should occur, SQL Mail, which is running as part of the MSSQLServer service, never sees the dialog box and stops responding at this point. You might have to stop the Mapisp32.exe application or even restart your Windows NT computer to clear the problem. Windows Messaging ClientThis client can be used with SQL Server 6.5 and 7.0 but cannot be used with SQL Server 2000. The Microsoft Windows Messaging mail client ships with Windows NT 4.0 and supports Microsoft Mail and Internet Mail (POP3/SMTP). There is a known issue with outgoing mail sent by SQL Mail being stuck in the Outbox unless the Windows Messaging client is open. This problem was caused by the MAPI spooler not being designed to be called from within a Windows NT service. This problem was fixed with Microsoft Windows NT 4.0 Service Pack 3 but the fix was not included in later Windows NT service pack builds because it caused product incompatibilities.If you installed Windows Messaging prior to applying Service Pack 3, you most likely have the fix for this problem. If you installed or reinstalled Windows Messaging after applying Service Pack 3, you need to contact Microsoft Product Support Services to obtain a fix for the Mapi32.dll file. To determine if you need a fix, find the Mapi32.dll file on the computer and check the date and size of the file. For example, if the date of your Mapi32.dll is 10/14/1996 and the size is 621 KB (file version 4.0), that file version causes outgoing SQL Mail to be stuck in the Outbox. If the Mapi32.dll file is dated 5/1/1997 and the size is 701 KB (the date and size of the fix included in Windows NT 4.0 Service Pack 3), that is the correct version of the file (also version 4.0). Because the version numbers are the same, it is more reliable to use the size and date of the file rather than the version number when you are determining whether or not you have the correct Mapi32.dll file. Windows Messaging is not included in Microsoft Windows 2000, so you need to purchase Microsoft Outlook to reliably use SQL Mail with an Internet mail server if you are using Windows 2000. Outlook 97 or Outlook 98 ClientThe Outlook 98 client can be used with SQL Server 6.5 and 7.0 but cannot be used with SQL Server 2000 unless you have applied SQL Server 2000 Service Pack 1.For additional information, click the article number below to view the article in the Microsoft Knowledge Base: 281293 (http://support.microsoft.com/kb/281293/EN-US/) FIX: SQL Mail 2000 Needs Outlook 2000 Client
Microsoft Outlook supports Exchange mail and
Internet mail (POP3/SMTP). Outlook 97 shipped with Microsoft Office 97 and
installs a Mapi32.dll file dated 12/20/96 with a size of 714 KB. Because
Outlook 97 was not designed to be used within a Windows NT service, the
Mapi32.dll file (version 4.00.993.3) causes outgoing e-mail from SQL Mail to be
stuck in the Outbox if the Outlook client is not left open on the server. To
resolve this problem, upgrade to Outlook 98 or Outlook 2000.Outlook 98 is a stand-alone product, intended as a replacement for Outlook 97. When you install Outlook 98, select the Corporate or Workgroup option. Do not select the Internet Only option. The Internet Only option installs only a stub (32 KB in size, dated 3/26/1998, version 5.5.2163.0) of the Mapi32.dll file and this file version does not work with SQL Mail. The correct Mapi32.dll version for Outlook 98 that works with SQL Mail is 5.5.2174.0, or later (dated 3/26/1998 and 857 KB). The Corporate or Workgroup option still allows you to use Outlook 98 with a POP3/SMTP Internet mail server. If you have installed Outlook 98 with the Internet Only option, in Control Panel, use Add/Remove Programs to rerun the Outlook 98 setup and reinstall the Outlook 98 components. You will also need to re-create your mail profile. Outlook 98 does not support Internet Message Access Protocol (IMAP)-based mail with the Corporate or Workgroup option. If you need IMAP support, you need to set up Outlook Express (in addition to Outlook) to send and receive IMAP-based mail. Use Outlook Express for sending and receiving IMAP-based mail and provide the Outlook mail profile for SQL Mail. Outlook 2000 ClientThis client can be used with SQL Server 6.5, SQL Server 7.0, and SQL Server 2000.Microsoft Outlook 2000 supports Exchange mail and Internet mail (POP3/SMTP) and ships with Microsoft Office 2000. The MAPI model was completely changed in Outlook 2000. Instead of a complete MAPI library, Outlook 2000 uses only a MAPI stub (128 KB in size). This module points to the correct MAPI library file to use, based on the language installed on the Windows NT computer (for example, the Msmapi32.dll file in the \Program Files\Common Files\System\Mapi\1033\NT folder). Replacing the Mapi32.dll stub with a different version breaks Outlook 2000 and you will need to run Fixmapi.exe to correct the problem. For additional information, click the article number below to view the article in the Microsoft Knowledge Base: 195795 (http://support.microsoft.com/kb/195795/EN-US/) OL2000: (CW) Troubleshooting Outlook Configuration Problems
Outlook 2000 also has to be installed with the Corporate or Workgroup option. To verify that you have installed Outlook 2000 properly, on the Outlook 2000 Tools menu, click Options. Click the Mail Services tab or the Mail Delivery tab, depending on how Outlook is currently configured. You will see a Reconfigure Mail Support command button. If you click Reconfigure Mail Support, a dialog box opens. If the Corporate or Workgroup option is not selected, click to select it and Outlook 2000 will reconfigure itself without requiring you to remove and reinstall the program. However, you must re-create your mail profile. NOTE: If you do make a change and you select the Corporate or Workgroup option, you must restart SQL Server for the changes to take effect. After you install Outlook 2000, there should be at least two Mapi32.dll files, one dated 1/14/1999, version 1.0.2536.0 that is in the \Winnt\System32 directory (for backward compatibility with mail-enabled applications like SQL Mail but is not used by Outlook 2000) and another file dated 1/26/1999, version 1.0.2518.0 in the \Program Files\Common Files\System\Mapi\1033\NT directory (used by Outlook 2000). If you do not have a Mapi32.dll file in the \Winnt\System32 directory, Outlook 2000 may work properly but you will not be able to start SQL Mail. If that happens, copy the Mapi32.dll file from the \Program Files folder to the \Winnt\System32 folder. In response to the threat posed by e-mail worms, Microsoft released a security patch for Outlook 2000 that notifies the user when a non-Outlook program attempts to send mail and requests the user to indicate whether this should be allowed by clicking Yes or No. Because SQL Mail is run through the SQL Server service, this security pop-up screen is sent to the virtual desktop and is never seen by a user. Because mail will not be sent pending user interaction, the end result is that SQL Mail will hang. This behavior can be seen with SQL Mail for SQL Server 6.5 or SQL Server 7.0 because they make a simple MAPI connection to the mail client and this will trigger the security pop-up screen. Because SQL Mail for SQL Server 2000 makes an extended MAPI connection, the security pop-up screen is bypassed. If your version of Outlook 2000 is 9.0.0.4201 or later (as seen in the "About Microsoft Outlook" box in Outlook 2000), you have the Outlook security update installed. Contact your Exchange administrator to see if it is possible to relax the default security constraints. For additional information, click the article number below to view the article in the Microsoft Knowledge Base: 263297 (http://support.microsoft.com/kb/263297/EN-US/) OL2000: Admin Info About the Outlook E-mail Security Update
Outlook 2002 ClientThis client can be used with SQL Server 2000.Microsoft Outlook 2002 supports Exchange mail and Internet mail (POP3/SMTP) and ships with Microsoft Office XP. Outlook 2002 employs a unified configuration and does not provide separate configuration options for Corporate or Workgroup or Internet Mail Only. Outlook 2002 also includes security features that first appeared in the Outlook 2000 security patch to protect against e-mail worms. In Outlook 2002, the MAPI spooler logic was moved in-process, so any non-Exchange messages sent (such as those to an Internet mail server) require the Outlook client to be actively running on the server computer. If the Outlook client is not left open, outgoing messages will remain in the Inbox until such time as the Outlook client is opened when they will be sent. This behavior is not seen with messages sent to an Exchange server. The Microsoft Outlook 2002 e-mail security features provide additional levels of protection against malicious e-mail messages. The important feature from the SQL Mail perspective is the confirmation of automatic sending of e-mail messages. Because the security features are triggered by a simple MAPI connection, Outlook 2002 when used with SQL Mail on SQL Server 6.5 and SQL Server 7.0 may cause SQL Mail to hang due to the security pop-up screen. Contact your Exchange administrator to see if it is possible to relax the default security constraints. For additional information, click the article number below to view the article in the Microsoft Knowledge Base: 290499 (http://support.microsoft.com/kb/290499/EN-US/) OL2002: Administrator Info About E-Mail Security Features
Internet Explorer and Outlook Express ClientUse of Outlook Express with SQL Mail is not supported because SQL Mail requires a mail profile and Outlook Express does not create one. Even if you have not explicitly set Outlook Express as your default mail client, installation or upgrading of Internet Explorer might cause Outlook Express to be set as your default mail client.On some versions of Internet Explorer or Outlook Express (for example, Internet Explorer 5.0), SQL Server ignores the supplied mail profile and attempts to use the default mail client. For example, if the default mail client is Outlook Express, SQL Mail may ignore the supplied Outlook mail profile (even though the profile tested successfully with the SQL Mail Test button) and attempt to start with Outlook Express. If Outlook Express was not configured to connect to a POP3/SMTP server, SQL Mail then stops responding or reports error messages about being unable to connect to the mail server. If you attempt to start SQL Mail through SQL Enterprise Manager and it stops responding, you might have to use Task Manager to perform an End Task on the SQL Enterprise Manager to clear the problem. To determine which default mail client you are using, follow these steps:
In addition to making Outlook Express your default mail client, the Internet Explorer installation might also rename your working Mapi32.dll file to Mapi32x.dll in order to install a MAPI stub for Outlook Express. If you then attempt to start SQL Mail, it fails when it attempts to use this MAPI file. If you had a working SQL Mail configuration prior to the installation or upgrade of Internet Explorer, search your \Winnt\System32 directory to see if it contains a Mapi32.dll and a Mapi32x.dll. If there is a significant size difference between these two files (for example, 128 KB for Mapi32.dll and 701 KB for Mapi32x.dll), exchange (swap) the names of these two files and attempt to start SQL Mail again. Additional InformationFor additional information, click the article numbers below to view the articles in the Microsoft Knowledge Base:311231 (http://support.microsoft.com/kb/311231/EN-US/) INF: Frequently Asked Questions - SQL Server - SQL Mail
315886 (http://support.microsoft.com/kb/315886/EN-US/) INF: Common SQL Mail Problems
For more information, see the following Microsoft
Web site:
Support WebCast: Troubleshooting Microsoft SQL Mail http://support.microsoft.com/kb/324689 (http://support.microsoft.com/kb/324689) For more information, refer to the following book: Microsoft Corporation Microsoft SQL Server 7.0 System Administration Training Kit (https://www.microsoft.com/mspress/books/1500.aspx) Microsoft Press, 2001 APPLIES TO
| Article Translations
|
Back to the top
