我正在使用PHPMailer发送电子邮件
当我执行向X@Y.Z发送电子邮件的代码时,我仍然收到此电子邮件,不仅是一次,而且每次刷新我的收件箱时,我都会收到许多副本!
注意:我只执行一次代码!!
那有什么不对?
这是我的代码:
$mail = new PHPMailer();
$mail->CharSet = 'UTF-8';
$body = "bla blas";
$mail->IsSMTP(); // telling the class to use SMTP
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Host = "xxx.xxx.xxx.xxx";
$mail->Port = 25;
$mail->Username = "****";
$mail->Password = "****";
$mail->SetFrom('z@z.z');
$mail->AddReplyTo("z@z.z");
$mail->Subject = "test";
$mail->MsgHTML($body);
$mail->AddAddress('X@Y.Z');
if(!$mail->Send()) {
//echo "Mailer Error: " . $mail->ErrorInfo;
} else {
//echo "Message sent!";
}
谢谢!