PDA

View Full Version : Send email according to time?


SDP2006
08-31-2003, 05:56 PM
Can someone show me how this would work?

<?php

if time == 2AM && day==Sunday
{
mail($recipient,$subject,$message,etc.etc.)
}
else
{
print("It is not time to send");
}
?>

Nightfire
08-31-2003, 06:30 PM
Using php to send things at certain times/days/months wouldn't work right as you'd need to execute the php script exactly the right moment for the email to be sent, which in the end would be completely pointless in having the time delay.

You'll need cron jobs to do what you're after

SDP2006
08-31-2003, 08:15 PM
Okay, I've written the script.

How do I write the cron?

Nightfire
08-31-2003, 08:44 PM
http://www.4webhelp.net/tutorials/misc/cron.php Might help you :)

SDP2006
08-31-2003, 09:01 PM
Thanks again, nightfire :thumbsup: