"L'Angel Admirable" <ja*******@para dise.net.nz> wrote in message
news:9e******** **********@news 02.tsnz.net...
Hi,
I have an auction site running. Now I want the auction to be able to
automatically send a mail msg to the seller after it expires. How do I do
it? Obviously there is some sort of way that I can employ so that this
task does not require an operator (such as me) to run manually. This task will
involve accessing the database and sending an email. Can somebody
enlighten me on this?
==James==
PHP does not have a job scheduler so the short answer is no, you can't do
this reliably using PHP alone.
The long answer is that you could have an external schedular, like
Unix/Linux cron that could call and activate your script... Alternativly,
you could have some check that when ever anyone visits your site, it checks
cloesd auctions and creates the mailers... but this would mean that the
email activity would only be acivated (unknowingly) by a visitor - thus a
server with a period of inactivity would not send the mailers... It really
wouldn't be reliable and could give mixed if implemented badly (ie two folk
visiting at the same time initiating two checks on the same auctions
resulting in two or more emails being sent out with the same notification
messages contained - or a timeout occuring before the scripts have properly
completed).
Your best bet would be an external schedular, like cron.