Phpmailer AddBcc 不工作

2024-03-16

我正在使用 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("[email protected] /cdn-cgi/l/email-protection",$toname);                
$mailer->Subject = $subject;                
$mailer->Body =$content;                
$mailer->AddCC("[email protected] /cdn-cgi/l/email-protection", "bla");               
$mailer->AddBCC("[email protected] /cdn-cgi/l/email-protection", "test");
if(!$mailer->Send())
{
echo "Message was not sent";
}
else
echo "mail sent";

Use as

$mailer->AddBCC("[email protected] /cdn-cgi/l/email-protection", "test");
$mailer->AddCC("[email protected] /cdn-cgi/l/email-protection", "bla");
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Phpmailer AddBcc 不工作 的相关文章

随机推荐