I have C# web application that I want it to send out an email on a certain date, such as if equipment isn't returned on the day it was due. Data is in MS SQL database.
I've got all the email code already done, and I'm just curious how do I trigger this email, say after the COB on that particular day?
Thanks,
Eric
Create a small console application that runs as a scheduled task.
It would do something like the following:
if the send date is equal to DateTime.Now then send the emailforeach emailUpdated
You mentioned you would like to do this with a trigger.. well I have never done that before, but have looked into it. I went with the console application approach. I liked this better. But here is a link on what I found on the trigger approach.
You make an application that queries the database for all emails that should be sent out today and sends the emails. You then schedule that application to run each day with task scheduler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With