3

Is there a way in ASP.NET C# to raise a event on a given time daily to run a procedure and send emails 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.

orftz
  • 1,138
  • 13
  • 22
Moksha
  • 1,030
  • 6
  • 17
  • 38
  • 1
    possible duplicate of [ASP.Net:Best way to run scheduled tasks](http://stackoverflow.com/questions/542804/asp-netbest-way-to-run-scheduled-tasks) – John Saunders May 31 '11 at 06:02

3 Answers3

1

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.

orftz
  • 1,138
  • 13
  • 22
Akram Shahda
  • 14,655
  • 4
  • 45
  • 65
1

Have a look at this ASP.Net:Best way to run scheduled tasks

Community
  • 1
  • 1
ajay_whiz
  • 17,573
  • 4
  • 36
  • 44
0

Use System.Timers.Timer and do what you need in the callback.

Xaqron
  • 29,931
  • 42
  • 140
  • 205