Send PHP Mail in intervals

Posted by iHeff on Stack Overflow See other posts from Stack Overflow or by iHeff
Published on 2012-10-14T21:16:42Z Indexed on 2012/10/14 21:37 UTC
Read the original article Hit count: 236

Filed under:
|
|

I'm working on a simple text messaging service for my high school's student council and my hosting service only allows 19 PHP mail messages to be sent per minute, so is there a way I can set an interval to only send 15 emails, wait a minute, send another 15, wait, and do so until all the mail is sent? Below is some of my code, all you'll probably need to see is the "foreach" section.

$subject =     ""; 
$message =     "Hey, $first! $messageget";

$header =     'From: Student Council<[email protected]>' . "\r\n" .
               'Reply-To: [email protected]' . "\r\n" . 
              'X-Mailer: PHP/' . phpversion(); 


foreach($to as $value) { 

    $result = mail($value, $subject, $message, $header); 



} 

© Stack Overflow or respective owner

Related posts about php

Related posts about email