gpt4 book ai didi

php 邮件密件抄送多个收件人

转载 作者:IT王子 更新时间:2023-10-28 23:58:00 24 4
gpt4 key购买 nike

如何制作密件抄送邮件?如果我发送该邮件,它会显示所有收件人!

$to=array();
$members_query = mysql_query("select email from members");
while( $row = mysql_fetch_array($members_query) )
{
array_push($to, $row['email']);
}

// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";

// Additional headers
//$headers .= 'To: '.$newName.' <'.$newEmail.'>' . "\r\n";
$headers .= 'From: SmsGratisan.com <admin@website.com' . "\r\n";


mail(implode(',', $to), $title, $content, $headers);

谢谢!

最佳答案

将您的mail 字段设置为null,然后在您的标题中内爆您的$to 数组

$headers .= 'From: SmsGratisan.com <admin@website.com>' . "\r\n";
$headers .= 'BCC: '. implode(",", $to) . "\r\n";


mail(null, $title, $content, $headers);

关于php 邮件密件抄送多个收件人,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14238207/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com