我试图通过CC使用AddAddress向用户发送电子邮件,并通过CC将另外三封电子邮件发送给管理员,依此类推。我可以使用AddAdress()发送电子邮件,但不使用Add CC。下面是我的代码。
<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "mail.test.com.my"; // SMTP server
$mail->From = "[email protected]";
$mail->AddAddress($email);
$mail->Subject = "Colourful email";
$mail->Body =$message;
/*$mail->WordWrap = 50;*/
$mail->AddCC =($email_1);
$mail->AddCC =($email_2);
$mail->AddCC =($email_3);
if(!$mail->Send()) {
echo 'Message was not sent.';
echo 'Mailer error: ' . $mail->ErrorInfo;
} else {
echo 'Kindly check your email for the confirmation of your rental.Thank you.';
}
?>
最佳答案
您不需要在此=
$mail->AddCC($email_1);