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('[email protected]','[email protected]'); foreach($to as $mail) { usleep(60000000); mail($mail,$subject,$email,$headers); } ?> Thank you for your assistance.. Quote Link to comment https://forums.phpfreaks.com/topic/261620-change-destination-email-in-looping-email/ 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 https://forums.phpfreaks.com/topic/261620-change-destination-email-in-looping-email/#findComment-1340605 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 https://forums.phpfreaks.com/topic/261620-change-destination-email-in-looping-email/#findComment-1340617 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 https://forums.phpfreaks.com/topic/261620-change-destination-email-in-looping-email/#findComment-1340699 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('[email protected]','[email protected]'); foreach($to as $mail) { usleep(60000000); mail($mail,$subject,$email,$headers); } $to = array('[email protected]','[email protected]'); 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 https://forums.phpfreaks.com/topic/261620-change-destination-email-in-looping-email/#findComment-1340943 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.