Phpmailer AddBcc无法正常工作 [英] Phpmailer AddBcc not working

查看:198
本文介绍了Phpmailer AddBcc无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用phpmailer发送电子邮件,并且它的工作原理是收件人接收邮件,但密件抄送和抄送详细信息未显示该邮件.有人可以提出解决方案 . 代码是

I am using phpmailer to sent email, and it works the recipients receive the mail except the bcc and cc details is not showing the mail. Someone can suggest a solution to this . the code is

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";

推荐答案

用作

$mailer->AddBCC("foo@gmail.com", "test");
$mailer->AddCC("something@gmail.com", "bla");

这篇关于Phpmailer AddBcc无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆