Using SQL Mail

SQL Mail requires a post office connection, a mail store (mailbox), a mail profile, and the Microsoft® Windows NT® domain user account used to log in to Microsoft SQL Server™. SQL Mail consists of a number of stored procedures, which are used by SQL Server to do one of the following: process e-mail messages that are received in the designated SQL Mail account mailbox, or reply to e-mail messages generated by the stored procedure xp_sendmail.

SQL Mail must run using a mail profile created in the same domain account that is used to start SQL Server 7.0. Under the Support Services folder in SQL Server Enterprise Manager, you can see a graphical depiction of the SQL Mail Service and determine if the service is running. You can start SQL Mail automatically by clicking Autostart SQL Mail when SQL Server Starts. After SQL Mail starts, you can use the stored procedures to send and receive mail.

To configure a mail profile

To set up SQL Mail

Processing an E-mail Request Received by SQL Server

To process e-mail automatically, you must create a regularly scheduled job that uses the stored procedure, sp_processmail. sp_processmail checks your SQL Mail mail profile, and then checks your mailbox for mail. sp_processmail uses xp_sendmail to execute query requests contained in the text of the e-mail, and then returns the result set to the original sender and any additional recipients. For example, a supplier may be allowed to execute a stored procedure that produces current inventory levels for all materials supplied by their organization.

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.