我正在使用phpmailer发送邮件。
有时收到的邮件有时未收到,但在两种情况下,当未收到邮件时,邮件功能返回值均为true均不会给出任何错误消息。
$mail = new PHPMailer;
$mail->IsSMTP();
$mail->Host = "domain name here";
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Port = 465;
$mail->Username = "*******";
$mail->Password = "*******";
$mail->From = "info@domainname";
$mail->FromName = "*******";
$mail->AddAddress($to);
$mail->IsHTML(true);
$mail->Subject = $subject;
$mail->Body = $message;
if($mail->send()):
return true;
else:
return $mail->ErrorInfo;
endif;