dantoni Posted April 26, 2012 Share Posted April 26, 2012 Hello.. I've a problem about how to change our destination and the consecutively. As example, today the email will be sent to A,B,C and tomorrow the email will be sent to B,C,A until next week. Next week the email will be sent to D,E,F. Code for looping email.. <?php $to = array('ikrom.shabri@yahoo.com','1.k.rom.pc@gmail.com'); foreach($to as $mail) { usleep(60000000); mail($mail,$subject,$email,$headers); } ?> Thank you for your assistance.. Quote Link to comment Share on other sites More sharing options...
rythemton Posted April 26, 2012 Share Posted April 26, 2012 If you just want the order to be mixed up, you could use the shuffle function. Quote Link to comment Share on other sites More sharing options...
dantoni Posted April 26, 2012 Author Share Posted April 26, 2012 And how to combine with a date time ? Quote Link to comment Share on other sites More sharing options...
Jessica Posted April 26, 2012 Share Posted April 26, 2012 Hello.. I've a problem about how to change our destination and the consecutively. As example, today the email will be sent to A,B,C and tomorrow the email will be sent to B,C,A until next week. Next week the email will be sent to D,E,F. You need to define a clear logic. Sending emails to three people is the same regardless of what order you send them in. Figure out your logic, because what you've said doesn't make much sense. Quote Link to comment Share on other sites More sharing options...
dantoni Posted April 27, 2012 Author Share Posted April 27, 2012 For example, today i want deliver the message to client A,B,C and D. Here the code... <?php $to = array('ikrom.shabri@yahoo.com','1.k.rom.pc@gmail.com'); foreach($to as $mail) { usleep(60000000); mail($mail,$subject,$email,$headers); } $to = array('me@gmail.com','you@hotmail.com'); foreach($to as $mail) { usleep(120000000); mail($mail,$subject,$email,$headers); } ?> and 1 week later, the destination automatically change to client E,F,G,H. What function should I use for this case ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.