quantumdecipher Posted April 28, 2011 Share Posted April 28, 2011 Hi guys, Basically I am developing a page where the order status of customers are listed in a tabular form, what I need now is to mail these data to my email address at a defined date (e.g. 1st day of next month) automatically. I do not know how to code this since I am just self studying and is still a noob. Thanks. Link to comment https://forums.phpfreaks.com/topic/234928-script-to-email-a-variable-at-defined-server-date/ Share on other sites More sharing options...
JKG Posted April 28, 2011 Share Posted April 28, 2011 Hi. Depends if this is every month or just a one off. you could use something clumsy like this: <?php $today = date("Ymd"); if($today == '20110501'){ mail($address, $subject, $msg, "From: $email\r\nReturn-Path: $email\r\n"); } ?> but would only work if the script is executed. why not write your mail code in a file, then use a cron job to execute on the 1st of the month, or the 1st of every month? Link to comment https://forums.phpfreaks.com/topic/234928-script-to-email-a-variable-at-defined-server-date/#findComment-1207439 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.