I'm trying to send mail over PHPMailer. Since 10 days PHPMailer don't send e-mail and throw an exception:
{
"code": "ERROR",
"message": "SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting"
}
This is below my code: It was working
$mail = new PHPMailer(true);
try {
// Server settings
$mail->isSMTP();
$mail->Host = 'localhost';
$mail->SMTPAuth = false;
$mail->Port = 25;
// Recipients
$mail->setFrom($this->mailAddress, $this->mailName);
$mail->addAddress($email);
// Content
$mail->isHTML(true);
$mail->Subject = 'Réinitialisation du mot de passe';
$mail->CharSet = 'UTF-8';
$mail->Encoding = 'base64';
$mail->Body = 'test';
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
return $mail->send();
I tried to upgrade PHPMailer to 6.1.7. I thought that PHPMailer had a security issues according to packagist
.
Can someone help me to fix this error