密件抄送不与邮件附件结合使用

时间:2013-06-13 09:44:18

标签: php email bcc

有谁可以告诉我为什么密件抄送不起作用?有一些我做错了不能缝合来解决它。另外我想知道我是否可以这种方式添加多个密件抄送邮件地址。

$headers .="Bcc: email address1\r\n";
$headers .="Bcc: email address2\r\n";

邮件代码

$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
$headers="From:test<$email_from>\r\n"; // Who the email is from (example)
$headers.="Bcc:test@test.com\r\n";
$headers.= "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$mime_boundary}\"";
$email_message .= "This is a multi-part message in MIME format.\n\n" .
"--{$mime_boundary}\n" .
"Content-Type:text/html; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" . $email_txt;
$email_message .= "\n\n";
$data = chunk_split(base64_encode($data));
$email_message .= "--{$mime_boundary}\n" .
"Content-Type: {$fileatt_type};\n" .
" name=\"{$fileatt_name}\"\n" .
"Content-Transfer-Encoding: base64\n\n" .
$data . "\n\n" .
"--{$mime_boundary}--\n";

mail($email_to,$email_subject,$email_message,$headers);`

0 个答案:

没有答案