我有一个表单,用于填写PHP邮件并发送给我们的客户。由于隐私原因,我想将大部分客户的邮件地址抄送(BCC)给他们。以下是我的代码:
$to = "******@e-track.co.za"; //To recipients
$email_from = '*****@etrackbureau.co.za';//<== update the email address
$email_subject = "New Overdue Loaded";
$email_body = "A new High Risk Client has been loaded by $name $company.\n".
"\n Client Name: $driver_name $driver_surname\n
\n Client ID or Passport Number: $driver_id\n
\n Nationality: $driver_nationality\n
\n Reason for Loading Client: $type\n
\n Notes: $notes\n
".
$headers = "From: $email_from \r\n";
$headers = "Bcc: ******@e-track.co.za;*****@e-track.co.za;******@e-track.co.za\r\n";
//$headers = "Reply-To: $visitor_email \r\n";
//Send the email!
mail($to,$email_subject,$email_body,$headers);
我已经将密送抄送地址添加到了$headers中,但是一旦添加后,邮件就完全无法发送;如果我将其移除,则可以将邮件成功发送给$to收件人。
我尝试过在密送抄送地址之间添加空格。由于垃圾邮件的原因,我用****代替了邮件名称。