Here is the enire cron job file (cron.php) that send out the daily emails.
<?php ini_set('display_errors', 'On'); $time = time(); require_once 'incs/config.php'; require_once 'incs/functs.php'; $query = 'SELECT * FROM dn_subs WHERE next_email < '.$time.' AND next_email > 0 AND verified_on > 0'; $qh = query($query); while ($row = mysql_fetch_assoc($qh)) { $rdiff = $row['timezone'] - (-5); if ($rdiff > 0) $time = strtotime('+'.$rdiff.' hours', time()); else $time = strtotime($rdiff.' hours', time()); $tdiff = time() - $time; $row['fyear'] = date('Y', $time); $row['fmonth'] = date('n', $time); $row['fday'] = date('j', $time); $_REQUEST = $row; /* ob_start(); include 'totdnumeros-email-nr.php'; $email_cont = ob_get_contents(); ob_end_clean(); */ $url = 'http://www.certuspersonality.com/dnumeroscope/totdnumeros-email-nr_tda.php?id='.$row['id'].'&ch='.md5('d'.$row['id'].'e').'&time='.$time; $url2 = 'http://www.certuspersonality.com/dnumeroscope/totdnumeros-email-nr_tmo.php?id='.$row['id'].'&ch='.md5('d'.$row['id'].'e').'&time='.$time; $url3 = 'http://www.certuspersonality.com/mnumeroscope/totmnumeros-email-nr_tmt.php?id='.$row['id'].'&ch='.md5('d'.$row['id'].'e').'&time='.$time; $url4 = 'http://www.certuspersonality.com/mnumeroscope/totmnumeros-email-nr_nmt.php?id='.$row['id'].'&ch='.md5('d'.$row['id'].'e').'&time='.$time; $sus_url = 'http://www.certuspersonality.com/dnumeroscope/unsubdnumeros-email-nr.php?email='.urlencode($row['email']); $email_cont = '<p>Dear '.$row['nickname'].',</p> <p></p> This is a special free service from certuspersonality.com. <p></p> Your Daily and Monthly Numeroscopes are now available! <br /> Click on the links below. <p></p> Today\'s numeroscope: <br /> <a href="'.$url.'">'.$url.'</a> <p></p> Tomorrow\'s numeroscope: <br /> <a href="'.$url2.'">'.$url2.'</a> <p></p> The energies of the days are embedded in those of their months, so you have to be aware of them. <p></p> This Month: <br /> <a href="'.$url3.'">'.$url3.'</a> <p></p> The Month ahead: <br /> <a href="'.$url4.'">'.$url4.'</a> <p></p> Organize your life wisely! <br /> certuspersonality.com. <p></p> To unsubscribe, go to: <br /> <a href="'.$sus_url.'">'.$sus_url.'</a>'; $sub = 'Daily/Monthly Numeroscopes for '.date('l, F jS, Y', $time).' by certuspersonality.com'; $headers = 'From: <do-not-reply@certuspersonality.com>'."\r\n"; // $headers .= 'To: '.$row['nickname'].' <'.$row['email'].'>'."\r\n"; $headers .= 'Content-Type: text/html'."\r\n"; mail($row['email'], $sub, $email_cont, $headers); //echo date('m/d/Y H:i:s', $time)."\r\n"; $next_time = strtotime('+1 day', $time); $row['fyear'] = date('Y', $next_time); $row['fmonth'] = date('n', $next_time); $row['fday'] = date('j', $next_time); $ntime = mktime(1, 0, 0, $row['fmonth'], $row['fday'], $row['fyear']); //echo date('m/d/Y H:i:s', $ntime)."\r\n"; if ($rdiff > 0) $ntime = strtotime('-'.abs($rdiff).' hours', $ntime); else $ntime = strtotime('+'.abs($rdiff).' hours', $ntime); //echo date('m/d/Y H:i:s', $ntime); $sql = 'UPDATE dn_subs SET next_email = '.$ntime.' WHERE id = '.$row['id']; query($sql); } ?>