开发者

PHP additional BCC email

How can I add a BCC to this?

$mail_From = $From_email;
$mail_To = $payer_email;
$mail_Subject = $Subject_line;
开发者_C百科$mail_Body = $email_msg;

mail($mail_To, $mail_Subject, $mail_Body, $mail_From);

Thanks for tips. Michael


This is explained pretty clearly in the manual.

Use the additional_headers argument, eg

$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));


Use headers to add information to your email (like CC, BCC, FRom, ecc.):

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

// or 'Content-type: text/plain;'

$headers .= 'From: '.$mail_From. "\r\n";
$headers .= 'Bcc: '.$mail_Bcc."\r\n";

mail($mail_To, $mail_Subject, $mail_Body, $headers);

See mail() on php manual for better details. Also, I suggest using good libraries like PhpMailer

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜