for($f=0; $f<count($person); $f++){
$messageUser = "<div style='display: block; width: 520px; background-color: #edeeef; padding: 10px;'>
<p>Please confirm the payment voucher for<br>
<br>Request by: ".$usercreated."
<br>Voucher Name: ".$pv_name."
<br><br>Your pin no: <strong>".$pin[$f]."</strong>
<button>Confirm Account</button>
</a>
</div>
";
$headers .= "Reply-To: Nothing <admin@nothing.com>\r\n";
$headers .= "Return-Path: Nothing <admin@nothing.com>\r\n";
$headers .= "From: Nothing <admin@nothing.com>\r\n";
$headers .= "Bcc: Nothing <sales@nothing.com>\r\n";
$headers .= "Organization: Nothing\r\n";
$headers .= "MIME-Version: 1.0\r\n";
// $headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "Content-type: text/html\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-Mailer: PHP". phpversion() ."\r\n" ;
$from = "admin@nothing.com";
$retvaladmin2 = mail($person[$f],$subject,$messageUser,$headers, "-f" . $from);
if($retvaladmin2){
$statusemail = 'success';
}
echo $person[$f];
echo "<br>";
echo $statusemail;
echo "<br>";
}
我想为不同的收件人发送 $pin[$f] 的验证码,每个收件人都有唯一的密码。我让它循环发送电子邮件。第一个收件人收到了电子邮件,但第二个收件人没有。它显示错误554 Transaction failed: Duplicate header 'From'
绝地无双