单击复选框后发送电子邮件

时间:2013-01-03 07:25:58

标签: sql sql-server sql-server-2008 sql-server-2008-r2

I have the checkbox in the front end called "Ticket". If Ticket checkbox is clicked then an email will be sent to the reciepents.

Here I know who are the reciepients, so that is not the problem. Also email body is ready.

Only, I want the condition in the query when the ticket check box is clikced that email should be sent. There is also the hasticket bit field in table which I am using. So initially, this hasticket field will be 0. How I can achieve this?

This is the sample data:

Pass NO. hasticket   name
A1234      0          abc

当我点击前端的复选框时,应该向abc发送一封电子邮件。

这就是我所拥有的:存储了proc sppass_update,它将更新表中的hasticket字段。所以首先我需要使用这个存储过程来更新表。然后我可以发送电子邮件。我怎么能搞这个

1 个答案:

答案 0 :(得分:1)

使用SQL Server的数据库邮件组件:

  1. 配置发送电子邮件的配置文件,例如使用SSMS向导。
  2. 使用您的参数调用sp_send_dbmail系统过程,以使用您配置的配置文件发送电子邮件。
  3. SQL Server将发送电子邮件。

相关问题