如何在web api应用程序中创建触发器

问题描述:

我写信是为了寻求如何在我的web-api应用程序中实现以下逻辑的建议。



我目前有一个web-api可以从数据库调用数据,但我想在API中添加触发器,只要有新的记录添加到数据库中,就可以创建并向我发送自动电子邮件。



我正在寻找任何框架或建议,涉及的过程以及我需要为此任务实施的内容。



非常感谢任何建议。



非常感谢。

I am writing to seek advice on how can I implement the following logic below within my web-api application.

I currently have a web-api which can call data from the database,but I would like to add trigger within the API, which can create and send automatic emails to me, whenever there is a new record added into the database.

I am seeking any framework or advice, in what process is involved and what I need to implement for this task.

Any advice would be very much appreciated.

Many thanks.

您需要调用方法发送邮件..在新记录之后已成功添加到数据库。



以下链接可以帮助您:

使用C#通过SMTP发送邮件 [ ^ ]



发送来自Yahoo!,GMail,Hotmail(C#)的电子邮件 [ ^ ]



http://social.msdn.microsoft.com/Forums/en-US/a75533eb-13 1b-4ff3-a3b2-b6df87c25cc8 / how-do-i-send-mail-using-c?forum = netfxnetcom [ ^ ]



如果你想配置数据库本身.....那就去吧:

SQL SERVER - 2008 - 配置数据库邮件 - 从SQL数据库发送电子邮件 [ ^ ]



谢谢。
You need to call method to send mail ..after the new record added to database successfully.

Following links would help you:
Sending Mail Using C# via SMTP[^]

Send Email from Yahoo!, GMail, Hotmail (C#)[^]

http://social.msdn.microsoft.com/Forums/en-US/a75533eb-131b-4ff3-a3b2-b6df87c25cc8/how-do-i-send-mail-using-c?forum=netfxnetcom[^]

if you want to configure the database itself.....then go for:
SQL SERVER - 2008 - Configure Database Mail - Send Email From SQL Database[^]

Thanks.