Jump to content

Change destination email in looping email


dantoni

Recommended Posts

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..

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.

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 ?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.