本文介绍了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("[email protected]",$toname);
$mailer->Subject = $subject;
$mailer->Body =$content;
$mailer->AddCC("[email protected]", "bla");
$mailer->AddBCC("[email protected]", "test");
if(!$mailer->Send())
{
echo "Message was not sent";
}
else
echo "mail sent";
推荐答案
用作
$mailer->AddBCC("[email protected]", "test");
$mailer->AddCC("[email protected]", "bla");
这篇关于Phpmailer AddBcc无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!