0

我正在使用 Phpmailer 发送邮件。除了密件抄送外,它运行良好。密件抄送收件人看不到抄送和收件人。为什么会这样?

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()
4

2 回答 2

0

来自 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 = '') {
  ...
}
于 2013-05-23T10:28:15.473 回答
0

很有可能这是一个 gmail 问题。您是否与其他 SMTP 服务提供商进行了测试?

于 2012-11-21T20:54:33.013 回答