Jump to content

Archived

This topic is now archived and is closed to further replies.

quantumdecipher

Script to Email a variable at defined server date

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.