gpt4 book ai didi

php - PHP邮件添加密件抄送

转载 作者:行者123 更新时间:2023-12-04 15:54:15 25 4
gpt4 key购买 nike

我有一个填写要发送给我们客户的PHP邮件的表格,由于隐私原因,我想对大多数客户进行密送。我有以下代码

$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收件人。

我也尝试了密件抄送邮件之间的间隔。由于垃圾邮件的原因,我用****替换了邮件名

最佳答案

您应该连接$headers


范例:

$headers  = "From: *****@etrackbureau.co.za\r\nX-Mailer: php\r\n";
$headers .= "MIME-Version: 1.0\r\n"; #Define MIME Version
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; #Set content type
$headers .= "Bcc: $EmailListHere\r\n"; #Your BCC Mail List

关于php - PHP邮件添加密件抄送,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43181025/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com