SQL Mail Stored Procedures

SQL Server 2000 provides built-in stored procedures and extended stored procedures that you can use to process e-mail messages received in a predefined SQL Mail account mailbox or to send e-mail messages from within your own SQL code. The following sections describe the stored procedures (with their corresponding syntax) that can be run individually or executed within the instructions of another stored procedure.


You use the xp_startmail procedure to start a mail client session. This procedure should be executed first to ensure that a SQL Mail session is running. The syntax for xp_startmail is as follows:

xp_startmail [@user = 'username'], [@password = 'password'] 

'username' is optional; when it's specified, ...

Get Microsoft® SQL Server™ 2000 Unleashed, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.