1

CCでメールを送りたいです。電子メールは正常に送信されますが、CC は送信されません。

$to = 'abc@xyz.com';
$subject = 'Order Details of Order Number:'.$orderID; 
$headers = "From: webmaster@xyz.com\r\nReply-To: webmaster@xyz.com";
$headers .= "\r\nContent-Type: multipart/alternative; boundary=\"PHP-alt-".$random_hash."\""; 
$message = "Test Message";
$headers .= 'Cc: def@xyz.com' . "\r\n";
mail($to, $subject, $message, $headers);

このメールは HTML 形式で送信しています。

4

2 に答える 2

0

このコードを次の順序で追加してみてください。

$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."\"";

リソース

于 2016-03-22T10:28:54.190 に答える