Gum*_*mbo 14
一个电子邮件不需要为头域.所以,你可以通过null或者一个空字符串为以参数,设置一个包含自己的头BCC报头字段,并为它提供了第四个参数additional_headers的mail:
$headerFields = array(
'BCC: user1@example.com, user2@example.com, user3@example.com'
);
mail(null, $subject, $message, implode("\r\n", $headerFields));
Run Code Online (Sandbox Code Playgroud)
Sar*_*raz 13
您可以为此指定第四个头参数:
$xheaders = "";
$xheaders .= "From: <$from>\n";
$xheaders .= "X-Sender: <$from>\n";
$xheaders .= "X-Mailer: PHP\n"; // mailer
$xheaders .= "X-Priority: 1\n"; //1 Urgent Message, 3 Normal
$xheaders .= "Content-Type:text/html; charset=\"iso-8859-1\"\n";
$xheaders .= "Bcc:email@example.com"\n";
$xheaders .= "Cc:email2@example.com\n";
//.......
mail($to, $subject, $msg, $xheaders);
Run Code Online (Sandbox Code Playgroud)
在$to现场,您可以指定您的电子邮件或任何您喜欢的.
请注意,您也可以使用逗号分隔多个电子邮件地址,但我不确定您可以通过这种方式指定的确切电子邮件数量.