如何在此添加BCC?
$mail_From = $From_email;
$mail_To = $payer_email;
$mail_Subject = $Subject_line;
$mail_Body = $email_msg;
mail($mail_To, $mail_Subject, $mail_Body, $mail_From);
感谢您的提示。 迈克尔
答案 0 :(得分:1)
manual中非常清楚地解释了这一点。
使用additional_headers
参数,例如
$mail_Headers = array(
'From: ' . $From_email,
'Bcc: somebody@example.com'
); // edit, oops, too used to using mail abstraction libraries
mail($mail_To, $mail_Subject, $mail_Body,
implode(PHP_EOL, $mail_Headers));
答案 1 :(得分:1)
使用标题向您的电子邮件添加信息(如CC,BCC,FRom,ecc。):
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
//或'Content-type:text / plain;'
$headers .= 'From: '.$mail_From. "\r\n";
$headers .= 'Bcc: '.$mail_Bcc."\r\n";
mail($mail_To, $mail_Subject, $mail_Body, $headers);
有关更多详细信息,请参阅mail() on php manual。另外,我建议使用像PhpMailer
这样的好库