Click here to Skip to main content
15,885,914 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Comments
Prasad Avunoori 18-Aug-14 7:03am    
Hi Miss786,

If your requirement is to trigger emails only, I suggest sending mails from backend only.
You may create a a database trigger on that table and create/send emails.

follow this link . http://www.codeproject.com/Articles/29060/SQL-SERVER-Configure-Database-Mail-Send-Email

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900