Phpmailer AddBcc 不工作
我正在使用phpmailer发送电子邮件,并且它的工作原理是收件人收到邮件,除了密件抄送和抄送详细信息未显示邮件。有人可以建议解决这个问题。代码是
require_once("PHPMailer_v5.1/class.phpmailer.php");
require_once("PHPMailer_v5.1/language/phpmailer.lang-en.php");
$mailer = new PHPMailer();
$mailer->IsSMTP();
$mailer->SMTPAuth = true;
$mailer->SMTPSecure = "tls";
$mailer->Host = 'smtp.gmail.com';
$mailer->Port = 587;
$mailer->Username = "myuserid";
$mailer->Password = "mypassword";
$mailer->FromName = $fromname;
$mailer->From = "myuserid";
$mailer->AddAddress("to@gmail.com",$toname);
$mailer->Subject = $subject;
$mailer->Body =$content;
$mailer->AddCC("something@gmail.com", "bla");
$mailer->AddBCC("foo@gmail.com", "test");
if(!$mailer->Send())
{
echo "Message was not sent";
}
else
echo "mail sent";