简体   繁体   中英

Better technique to send mail if new record inserted

I have a form to fill details, those records will inserted in db with columns name, email, phone, ismailsent. now i want to send an email to my admin team if any new record inserted into DB. any better technique like windows service, i want it to be very clean. any help appriciated

You don't give any details, but I guess you're looking for something like a database trigger. I don't know which DBMS you're using, but take a look at this post: C# / SQL Listener to tell me if a row has been inserted into a table

There are a few options for achieving this functionality, you could have a windows service or a web service which you invoke after you insert your record successfully, or you could use the SQL Server 2008 build in functionality (sp_send_dbmail), but you first need to configure it. Here are some posts that might help you:

Hope it helps. Cheers!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM