600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > php密送 向多个收件人发送电子邮件 – 抄送:和密送:在PHP中

php密送 向多个收件人发送电子邮件 – 抄送:和密送:在PHP中

时间:2021-02-11 17:20:10

相关推荐

php密送 向多个收件人发送电子邮件 – 抄送:和密送:在PHP中

该程序正在运行,但如何发送多个CC和BCC.

for($i = 0; $i < count($snteadd); $i++)

{

$subjt = $subject;

$mess = $message;

$toinfo .= $snteadd[$i];

$headers = "MIME-Version: 1.0 \r\n";

$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

$headers .= "from: \r\n";

$headers .= "Reply-To: \r\n";

$hedders .= "cc : \r\n" ;

$headers .= "Bcc : \r\n";

$headers .= "X-Mailer: PHP 4.x";

$sendbcc = $snteadd[$i] .",";

$sendbcc .= $sendCC . ",";

$sendbcc .= $sendBCC;

if($jvl != $i)

{

$toinfo .= ", ";

}

if($snteadd[$i] != "")

{

$result = mail($sendbcc, $subjt, $mess, $headers);

if(!$result)

{

$subjdis = "Auto Response for Message Sending Failed";

$headersdis = "MIME-Version: 1.0\r\n";

$headersdis .= "Content-type: text/html; charset=iso-8859-1\r\n";

$headersdis .="Message Sending Failed\r\n";

$headersdis .= "From: \r\n";

$msgdis = "Message Could not be Delivered to this Mail ID ".$snteadd[$i];

mail($fromemailid, $subjdis, $msgdis, $headersdis);

print "We encountered an error sending your mail

";

//echo $headersdis;

}

}

}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。