Automatically raise a event in ASP.NET C# to send emails
Is there a way in ASP.NET C# to raise a event on a given time daily to run a procedure and send emai开发者_如何学Gols to list of users with their sale report?
In a way, I want to keep a thread active in background in app_start event in global file.
I am on share hosting so don't have much power to update any setting on server as per my needs.
Why don't you build an application that send those emails and run it in a specific time using Windows Tasks Scheduler instead of keeping your application running all the time?
This way, after your application sends the emails and accomplish its task, you could simply end it and start it again whenever you need.
Have a look at this ASP.Net:Best way to run scheduled tasks
Use System.Timers.Timer
and do what you need in the callback
.
精彩评论