PHP Code:
$body=" ";
$mailSentOk = true;
$to= $log_id;
$subject= "welcome to company";
foreach(array('someone@somedomain.com','someoneelese@somedomain.com') as $reply_to)
{
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From:info@domain.com' . "\r\n";
$headers .= "CC:info@domain.com" . "\r\n";
$headers .= "Reply-To:".$reply_to . "\r\n";
$headers .= "Return-Path:".$log_id. "\r\n";
$mailSentOk = $mailSentOk && mail($to,$subject,$body,$headers);
}
if($mailSentOk)
{
$msg="email processed";;
}
else
{
$msg="order not processed";
}
Also, please note that mail returns whether the mail was succesfully
sent, not whether it was succesfully received!
And since the headers change you can't get them outside of the foreach.
Bookmarks