Jump to content
Sign in to follow this  
scottf

Send an email at a time

Recommended Posts

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 by scottf

Share this post


Link to post
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...