xp_sendmail (version 6.5)

Sends a message, and/or a query results set, and/or an attachment to specified recipients. The xp_sendmail extended stored procedure uses a bound connection for the @query parameter. The @query connection made by SQL Mail is not blocked by locks held by the client that issues the xp_sendmail request. This makes xp_sendmail easier to use from within triggers. The @query statement, however, cannot refer to the logical inserted and deleted tables that are only available within a trigger.

For additional syntax information for xp_sendmail, see the Microsoft SQL Server Transact-SQL Reference.