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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.