Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/275.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP表单-密件抄送邮件未从电子邮件表单发送_Php_Email_Bcc - Fatal编程技术网

PHP表单-密件抄送邮件未从电子邮件表单发送

PHP表单-密件抄送邮件未从电子邮件表单发送,php,email,bcc,Php,Email,Bcc,您好,这是我发送电子邮件的php代码,当邮件发送到密件抄送部分的地址时,不接收电子邮件: <?php $to = "abc@abc.com"; $subject = 'Form Submited To ABC Website'; $headers = "From: online@abc.com \r\n"; $headers .= "Bcc: info@abc.com \r\n"; $headers .= "MIME-Version: 1.0\r\n";

您好,这是我发送电子邮件的php代码,当邮件发送到密件抄送部分的地址时,不接收电子邮件:

<?php
$to = "abc@abc.com";
    $subject  = 'Form Submited To ABC Website';
    $headers = "From: online@abc.com \r\n";
    $headers .= "Bcc: info@abc.com \r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=utf-8\r\n";
?>

出于保密原因,这些邮件不是随机邮件

PHP mail()语法为:

bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )
查找下面的代码以了解更多信息

<?php
// multiple recipients
$to  = 'aidan@example.com' . ', '; // note the comma, if you have multiple or else no comma.
$to .= 'wez@example.com';

// subject
$subject = 'Hello';

// message
$message = '<html><body><h2>Testing MSG</h2></body>';

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= 'To: Jiten <Jiten@example.com>, Kelly <hi@example.com>' . "\r\n";
$headers .= 'From: from_name <from_name@example.com>' . "\r\n";
$headers .= 'Cc: cc_email@example.com' . "\r\n";
$headers .= 'Bcc: bcc@example.com' . "\r\n";

// Mail it
mail($to, $subject, $message, $headers);
PHP mail()语法是:

bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )
查找下面的代码以了解更多信息

<?php
// multiple recipients
$to  = 'aidan@example.com' . ', '; // note the comma, if you have multiple or else no comma.
$to .= 'wez@example.com';

// subject
$subject = 'Hello';

// message
$message = '<html><body><h2>Testing MSG</h2></body>';

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= 'To: Jiten <Jiten@example.com>, Kelly <hi@example.com>' . "\r\n";
$headers .= 'From: from_name <from_name@example.com>' . "\r\n";
$headers .= 'Cc: cc_email@example.com' . "\r\n";
$headers .= 'Bcc: bcc@example.com' . "\r\n";

// Mail it
mail($to, $subject, $message, $headers);