php邮件bcc多个收件人 [英] php mail bcc multiple recipients
本文介绍了php邮件bcc多个收件人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何制作密件邮件?
如果我发送邮件,它显示所有的收件人!
How do I make a bcc mail? If I send that mail, It shows me all the recipients!
$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);
谢谢!
推荐答案
将您的邮件
设置为字段到 null
,然后打开您的 $ to
数组在您的标题
Set your mail
to field to null
, and then implode your $to
array in your headers
$headers .= 'From: SmsGratisan.com <admin@website.com' . "\r\n";
$headers .= 'BCC: '. implode(",", $to) . "\r\n";
mail(null, $title, $content, $headers);
这篇关于php邮件bcc多个收件人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文