I have a problem with a mail script which loops an array sending an email via sendmail each time.
it's recently run into problems
and seems to be that if sendmail fails for more than a handful of emails then the loop seems to run again and everyone gets duplicates ( or more) messages.
I have put a timestamp in the loop ie
for ($i=0; $i<$list_email; ++$i)
{
$subject ="number ".$i;
$t=time(0);
$body="timestamp ".$t;
$fromaddress=trim($fromaddress);,else# mailfrom($fromaddress, $email[$i], $subject, $body, $headers) ;
}
exit;
}
so I know that message number 0 which appears twice is another runof the loop because the timestamp for both messages is different