I have a php file that send emails to our clients who are expecting it and to ease the load on the server and to eliminate it looking like a spam server we reduce the flow to 40 emails every 20 seconds. This is done by using javascript to rerun the page every 20 seconds. The page itself reads from a data base and gets the next 40 email addresses, sends them, and then recycles until all are sent. Then the email list is reloaded from a duplicate table for the next cycle three weeks out.
Here is the javascript code that seems to not run when initiated by a cron job
<script language="JavaScript" type="text/javascript">
setTimeout("location.href = \'PT_enrollment.php?sendDate='.$sendDate.'\'",20000); // milliseconds, so 10 seconds = 10000ms
</script>
When I run this from my browser it does run correctly so I guess it is in the Cron Job functionality.
What am I missing? Is there a setting or parameter I need to set in the crontab or on the server so it runs correctly?