Reminders System

Mondeo

Centurion
Joined
Nov 10, 2006
Messages
128
Location
Sunny Lancashire
I have a project where users enter memerable dates into a website, I store these dates to a database and then each day at a set time, the system loops thorugh the dates and for any that are 7 days in the future it sends an automated reminder to an email address also in the database.

I find this quite simple in theory but i'm not sure how to go about it, I presume I need to write an application which will run at the specified time each day, send the emails if there are any and then shut down again, it could be set as a scheduled task at the specified time.

Or would I be better with an application that ran continuously and monitored the time, if it was "time" then it could run the emails then wait for the correct time to come around again.

Or is there another way altogether that may be better?
 
I think both of your idea is not that different. The only thing differs is when your application will be running. You only need to chose whether to set a scheduled task for your application or you leave the application to run 24 hours a day.

I'd say choose the later option. That way you won't have to bother setting up any scheduled task. You're running a website right? So your application should be set up in a webserver right? If that's the case then you don't have to worry about running the application 24/7 right?

CMIIW.
 
Hi

We run websites but they are hosted for us, I would not be able to install this application or anything else on the webserver. I was going to use one of our own servers to run it on though.

So if I go with the second option whats the best way to do it, should I use a timer control set to fire every 30 seconds perhaps and then check the system time? Also probably best to do this on a seperate thread yes?

Thanks
 
I assume you have access to your database. It's a dead end if you can't access it. Anyway I agree about using the timer system. But do you really need to check it in a regular time basis, i.e. for every 30 seconds?

Didn't you mention that you're simply reminding about important dates? So if it's dates I think you only need to check it once every day. That way you won't have to deal with heavy computing power right. You'll only need one process running 24/7.
 
Yes your right, its for reminding important dates. But I want the emails to go out at the same time each day.

So should I set the time interval to 86400000 ? (24 hours = 1440 minutes = 86400 second = 86400000 milliseconds)

Then in the timers tick event, query the database, send the emails (if any) then thats it.

What about threading, should I do it all on one thread?
 
Back
Top