Troubleshooting SQL Mail with Exchange Server
Typically, errors in starting a SQL Mail session or sending mail from SQL Mail with Microsoft Exchange Server fall into two categories: permissions problems and Exchange client setup problems. For more information about SQL Mail, see SQL Server Books Online.
Examine this list of items, in this order:
- Log on to Microsoft Windows NT with the user account that will be used for the MSSQLServer service. This user account must be an administrator of the local computer and a domain account.
- Confirm that the Exchange Server client, Exchnge32.exe, or the Microsoft Outlook client, Outlook.exe, can connect to Exchange Server and that e-mail can be sent.
- Confirm that the Exchange Server profile used does not have a Personal Message Store (.pst).
- On the Services tab, confirm that the only services available are Microsoft Exchange Server and Personal Address Book, and then click the Delivery tab. Confirm that the selection in the Deliver To box is the mailbox on Exchange Server, which should have a name similar to "Mailbox - <Friendly User Name>" (where <Friendly User Name> is the name of the user who logged on to Windows NT in Step 1).
- To run SQL Mail with Exchange Server, the MSSQLServer service must be run under the same user account that logged on in Step 1. In Control Panel, double-click Services, select the MSSQLServer service, and then click Startup.
- Confirm that the SQL Mail profile is correct. In SQL Server Enterprise Manager, expand the server, expand the Support Services folder, select SQL Mail, and then right-click. Click Properties, and then on the General tab, verify that the profile name specified in the Profile name box is correct. If needed, click Test. The profile name must match the profile name used in Step 3.
- Test Microsoft SQL Server access permissions to Exchange Server by executing xp_cmdshell, which executes with the same permissions as SQL Mail. Use this command to test connectivity to the server, assuming Exchange Server is located on a computer named "NTServer".
xp_cmdshell "NET USE \\NTServer\IPC$"
If this command fails, Step 3 was not completed correctly.
It should now be possible to start SQL Mail either automatically or manually using xp_startmail. When using xp_startmail, the profile can be replaced by replacing <Profile name> below with the profile name used in Step 3:
xp_startmail '<Profile name>',''