Jump to content

Script to Email a variable at defined server date


quantumdecipher

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.

Link to comment
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?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...

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.