如何在我的邮件功能中发送密送或cc电子邮件,但我尝试过代码,但密件抄送或cc功能不起作用?

时间:2013-03-03 09:51:50

标签: php email sendmail

如何在我的邮件功能中发送bcc或cc电子邮件,但我已尝试过代码,但是bcc或cc功能无效?

<?php
//SENDS EMAIL THAT TELLS THE USER TO ACTIVATE THE ACCOUNT
$activation = 'activation.php?key='.$key;
$your_email = 'non-reply@mydomain.pk'; //CHANGE TO YOUR SETTINGS
$domain = $_SERVER["HTTP_HOST"]; //YOUR DOMAIN AND EXTENSION
$to  = $email;
$subject = 'MyDomain Activate Account';
$message .='<img src="http://mydomain.com/images/securedownload.jpg"/>';
$message = 'Welcome,<br/> '.$_POST['username'].'. You must activate your account via   this       message to log in. Click the following link to do so:   http://'.$domain.'/'.$activation;
$headers .= "BCC: MyDomain Order Copy <demo@mydomain.com>\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";  
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";  
$headers .= "From: MyDomain <'.$your_email.'@'.$domain.'>\r\n" .  
//"Reply-To: $from \r\n" .  
"X-Mailer: PHP/" . phpversion();    
?>

0 个答案:

没有答案