我正在尝试通过php使用SMTP库发送电子邮件,一切正常,我可以成功发送电子邮件,但是我的问题是,当我尝试将消息发送到伪造的电子邮件时,找不到这样的邮件(fdsffs @ dsf。 com) 我收到成功消息。这是我的代码
$mail->Subject = $subject;
$mail->MsgHTML($message);
if(!$mail->Send()) {
$errors=$mail->getSMTPInstance()->getError();
echo $msg= "Message Not Sent: to $to " . $mail->ErrorInfo;
$date=date('Y-m-d h:i');
$sql="insert into log (log_text,user_email,log_time,status)values ('$msg','$to','$date',0) ";
$this->query_return($sql);
exit();
} else {$date=date('Y-m-d h:i');
$sql="insert into log (log_text,user_email,log_time,status)values ( 'Message has been sent successfully ','$to','$date',1) ";
$this->query_return($sql);
}
}