Many database applications require email-sending functionality. For example, every time a table record is updated, an email notification needs to be sent to the system administrator. In the Microsoft SQL Server environment, AspEmail can be invoked directly inside a trigger or stored procedure using Transact-SQL.
The following code snippet creates a SQL Server stored procedure which sends an email message using AspEmail. You may use a similar approach for triggers, etc.