View Full Version : scheduling in asp
esthera
05-22-2006, 06:48 AM
I want to schedule a page to send out daily emails everyday at 12 a.m. -- is this possible?? I'm on a hosted server so I do have limitations there.
currently I implemented it to send out the first time someone hits the site but I really want it daily at the same time.
Roelf
05-22-2006, 06:58 AM
The best way is to crete a scheduled task on the server which calls your asp. But you can also schedule your own machine to call a page on the server which sends your mails. The machine with the scheduled task has to be switched on all the time (or set to standby with the option to "wake this machine to execute this task" on the task checked on)
esthera
05-22-2006, 07:03 AM
I don't think the host allows that....
tell me would it be crazy to have a sql server db hit the page at the set time each day?
Roelf
05-22-2006, 07:53 AM
I don't think the host allows that....
tell me would it be crazy to have a sql server db hit the page at the set time each day?
If the host doesnt allow scheduled tasks on the OS, i doubt if you are allowed to schedule a task in SQL server, but you can always try.
I think it is best to keep the scheduled task at the same machine as the software (in this case asp-page) is. So if it needs to be executed by the db, so be it.
(i didn't know it was possible to let SQL server call external applications using the scheduled task mechanism)
esthera
05-22-2006, 07:56 AM
so is there any other option -- I don't keep my computer on all the time.
Roelf
05-22-2006, 08:06 AM
so is there any other option -- I don't keep my computer on all the time.
I dont know any other option. I would go for the scheduling mechanism in SQL server if that is possible.
Spudhead
05-22-2006, 12:37 PM
Another random idea, but... how much traffic does your site get? If you're pretty much guaranteed that somebody will be doing something on the site at a set time each day, you could just put an include file on each page. It'd just check an application variable (or pull out of a database, whatever) for the "last sent" date, and run the daily code accordingly.
esthera
05-22-2006, 12:49 PM
that's what i'm doing now but my client wants it running at exactly 12:01 everyday
Spudhead
05-23-2006, 11:29 AM
Then you're stuck with scheduling tasks. And if you can't do it via the server OS (and you can't install anything on the server), and you can't do it via a remote machine (ie: your own), then SQL Server scheduling is, AFAIK, about your only option.
vBulletin® v3.8.2, Copyright ©2000-2010, Jelsoft Enterprises Ltd.