PRB: Outgoing SQLMail Messages Blocked and Not Sent

ID: Q124048


The information in this article applies to:
  • Microsoft SQL Server versions 4.20x, 6.0


SYMPTOMS

When you send a mail message using the xp_sendmail extended stored procedure, SQL Server returns the message "Mail sent." No errors occur, however, the mail message gets blocked and is not spooled or sent to the recipients.


CAUSE

This problem occurs if there is a problem with the mail spooler process. With SQLMail, there are two main situations that can cause the mail spooler process to stop running:

  1. The SQLServer or MSSQLServer service is running in the context of the System account with permission to interact with the desktop, and a user logs off the Windows NT computer while SQLMail is running. This causes the mail spooler process to be shut down because it is running on the user's desktop.

    In SQL Server versions 4.2x, this can cause an error message to appear stating that "SQLSERVER.EXE did not respond to the End Task request." This message occurs when Windows NT attempts to shut down the mail spooler. Choosing "End Task" in the dialog box will shut down the mail spooler, but not SQL Server. In SQL Server 6.0, the message does not occur and the mail spooler process is shut down.






  2. The MSSQLServer service is running in the context of a user account and the MS-Mail client (MSMAIL32.EXE), or any MAPI-enabled application, is being run on the SQL Server computer.



WORKAROUND

The following can be used as workarounds for situation number one mentioned earlier:

  • Stop and restart SQLMail after a user has logged off the Windows NT computer.


  • Use a password-protected screen saver so that you do not have to log on and off of the server.


  • In SQL Server 6.0, you have the option to run SQL Server in the context of a user account instead of the System account and still run SQLMail. If you do this, do not run the MS-Mail client on the same computer.




Situation number two has the following workarounds:
  • Do not run the MS-Mail client or any MAPI-enabled applications on the server when SQLMail is running.


  • Run SQL Server in the context of the System account with permission to interact with the desktop and prevent users from logging on and off the server.



MORE INFORMATION

With MAPI 0, the mail spooler process runs as an icon on the Windows NT desktop. If the SQLServer or MSSQLServer service has permission to interact with the desktop, that icon will appear on the server when a user is logged into Windows NT and SQLMail is running. If the user then attempts to log off Windows NT, all programs on the desktop (including the mail spooler) are shut down by Windows NT which prevents subsequent mail from being spooled.



If the MSSQLServer service is running in the context of a user account, the mail spooler does not have permission to interact with the desktop and therefore the spooler icon does not appear on the desktop. If SQLMail is started after the MS-Mail client is already running, a conflict occurs because SQLMail does not have permission to interact with the MS-Mail client and the spooler which are already running on the desktop.

Additional query words: sql6 sqlmapi mapi

Keywords : kbinterop kbprg SSrvProg
Version : 4.2 4.2x 4.21a 6.0
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: April 15, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.