1

I was wondering what is the best way to have a website created in ASP.Net MVC 4 C# to send off email and do other things when it needs to. I'll give you an example:

User A is to be notified via email 15 minutes before his appointment at 2:30pm central time. The system would then automatically send him an email at 2:15pm central time to remind him.

I know this is a simple question but I honestly don't want (unless that's the only way) to use a system where a it sits there and pings a page to check and send off notifications every minute (that's the only way I can think of as of right now.)

leppie
  • 115,091
  • 17
  • 196
  • 297
hjavaher
  • 2,589
  • 3
  • 30
  • 52
  • 4
    A separate Windows service is typically used for these tasks. The website may or may not be running at the due time. Have a look [here](http://stackoverflow.com/questions/11936684/c-sharp-code-that-run-constantly-service-or-separate-thread/11936723#11936723) and [here](http://stackoverflow.com/questions/4816452/asp-net-mvc-how-to-trigger-a-notification-event-after-a-date/4823640#4823640). – HABO Jan 07 '13 at 01:01
  • http://haacked.com/archive/2011/10/16/the-dangers-of-implementing-recurring-background-tasks-in-asp-net.aspx – Daniel Little Jan 07 '13 at 05:27

2 Answers2

1

Try taking a look at Quartz .Net. It's a .Net port of Quartz for Java. I've used it in the past for scheduling. You should be able to just have it running on a Windows service in the background and create a timed event when a user needs a reminder that would fire off X minutes before Y time.

jaryd
  • 861
  • 12
  • 21
0

The proper way to do this is through a window service. Instead of pinging a page, you get the window service to constantly poll the database or your datasource to know the current schedule for the tasks.

Jack
  • 2,600
  • 23
  • 29