简体   繁体   English

phpmailer添加密件抄送不起作用

[英]Phpmailer Add Bcc not working

I am using Phpmailer to send mail. 我正在使用Phpmailer发送邮件。 It is working perfectly except for the bcc. 除密件抄送外,它工作正常。 The Bcc recipient could not see the cc and the to. 密件抄送收件人看不到抄送和收件人。 Why is this happening? 为什么会这样呢?

require_once("PHPMailer_v5.1/class.phpmailer.php");
            $mailer = new PHPMailer();
            $mailer->IsSMTP();

            $mailer->SMTPAuth = true;
            $mailer->SMTPSecure = "tls";

            $mailer->Host = 'smtp.gmail.com';
            $mailer->Port = 587;            

            $mailer->Username = $userid;
            $mailer->Password = $epwd;
            $mailer->FromName = $fromname;
            $mailer->From = $userid;
            $mailer->AddAddress($to,$toname);
            $mailer->Subject = $subject;                
            $mailer->Body =$content;                
            $mailer->AddCC($cc, $tocc);             
            $mailer->AddBCC($bcc, $tobcc);          
            $mailer->AddAttachment($dest_filename);
            $mailer->Send()

There is a good chance this is a gmail issue. 这是一个Gmail问题。 Did you test with another SMTP service provider? 您是否与其他SMTP服务提供商进行了测试?

From class.phpmailer.php: 从class.phpmailer.php中:

/**
  * Adds a "Bcc" address. Note: this function works<br>
  * with the SMTP mailer on win32, not with the "mail"<br>
  ...
 */
function AddBCC($address, $name = '') {
  ...
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM