scottf Posted July 19, 2012 Share Posted July 19, 2012 (edited) My goal is to send an email at the time indicated below. (Every weds at 12). Here is my current code: <?php date_default_timezone_set('MST');$file = $_SERVER['DOCUMENT_ROOT'] . "/entries.txt"; //Path to your *.txt file$contents = file($file);$string = implode("", $contents); $to = "april@coastalmountaincreative.com";$subject = "My subject";$txt = $string;$header = "From: scott@avvecc.com"; $d = date( "w");$h = date( "G"); if ($d == 3) {if ($h == 12) { mail($to,$subject,$txt,$header);file_put_contents("entries.txt", "");}} ?> It works great, however if no one visits the page at 12 that day it never gets sent. How can I make it so it sends no matter what? Thanks. Edited July 19, 2012 by scottf Link to comment Share on other sites More sharing options...
Net123 Posted July 19, 2012 Share Posted July 19, 2012 i think u only can be dont it using of cron jobs in your cpanel .........http://en.wikipedia.org/wiki/Cron Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now