如何在Addcc中通过php变量发送多封电子邮件

时间:2016-07-07 17:28:28

标签: php email phpmailer

从$ list我收到使用explode后按表单发布的所有电子邮件

$list = explode(',', $guest_email);



    foreach ($list as $k => $v) {

        $mail = new PHPmailer();
        $mail->From = $smtp_user;
        $mail->FromName = $fromname;
        $mail->Mailer   = "mail";
        $mail->Subject = "";
        $mail->IsHTML(true);

        //$mail->IsSMTP();
        $mail->SMTPDebug = 1;
        $mail->SMTPAuth = ;
        $mail->SMTPSecure = '';
        $mail->Host = $smtp;
        $mail->Port = $port;

        $mail->Password = $sm;
        $mail->Username = $sm;

        $mail->Body = $bodyContent;

在下面的行中邮件将转到所有发布的电子邮件地址,在下一行我想以cc添加所有电子邮件,但它无法正常工作

$mail->AddAddress($v);
$mail->Addcc($v)
$mail->AddReplyTo($smtp_user);

if(!$mail->Send()){
    echo "Mailer Error: " . $mail->ErrorInfo;
}else{
    echo "SUCCESS";
}
}

如何在$ mail-> Addcc($ v)

中发送所有电子邮件

0 个答案:

没有答案