PHP insert cc into mail function [duplicate]

☆樱花仙子☆ 提交于 2019-12-02 02:35:52
Shawn Barratt

just tested this, and it worked as expected:

$headers .= 'Cc: test@test.com\r\n';
$headers .= 'Bcc: test@test.com\r\n';

I would also suggest moving your carriage return and new line to the end of the previous entry to $headers

$headers = "From: $from_email\r\nReply-To: $from_email";
$headers .= 'Cc: test@test.com\r\n';
$headers .= 'Bcc: test@test.com\r\n';
$headers .= "Return-Path: <info@premierinspectiontn.com>\r\n";

// add boundary string and mime type specification
$headers .= "Content-Type: multipart/mixed; boundary=\"PHP-mixed-".$random_hash."\"";

hope that helps

Try adding

$headers .= 'CC: other@url.com' . "\r\n";
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!