by Ray Rankins
IN THIS CHAPTER
Setting Up an E-Mail Client/Profile
Configuring SQL Mail
Configuring SQLAgentMail
SQL Mail Stored Procedures
One of the unique features of SQL Server 2000 is its ability to integrate with the existing server architecture of an established network. This integration provides SQL Server the functionality to send and receive messages and send query results to mail recipients via a configured mail provider.
SQL Server uses two separate mail sessions: one for SQL Server and one for SQL Server Agent. The MSSQLServer service uses a mail session that is referred to as SQL Mail. SQL Server uses the SQL Mail session when database applications execute the xp_sendmail extended stored procedure to send a message or query result set to a recipient. SQL Server Agent uses the SQLAgentMail mail session that is exclusive to SQL Server Agent activities to send messages related to job status or when an alert is triggered.
To send e-mail from SQL Server or SQL Server Agent, you must first set up a mail profile for the account(s) that SQL Server and SQL Server Agent run under and then associate the profile with SQL Server and SQL Server Agent. After that is completed, you can set up jobs, operators, and alerts for SQL Server Agent, which can be configured to notify the intended recipient by sending an e-mail or pager message through the SQL Agent mail system. You can also use the mail stored procedures provided with SQL Server to send messages or result sets to e-mail recipients.