PHPMailer don't sending email to gmail. But to other hosting its work.
No errors in debug. No other email its work.
Im using ovh smtp but website is in other hosting.
// Config
$mail = new PHPMailer();
$mail->isSMTP();
$mail->SMTPDebug = 3;
$mail->Port = 587;
$mail->SMTPSecure = "tls";
$mail->CharSet = "UTF-8";
$mail->Host = 'ssl0.ovh.net';
$mail->SMTPAuth = true;
$mail->Username = 'email';
$mail->Password = 'password';
// Header
$mail->setFrom('email');
$mail->addAddress('email');
// Content
$mail->isHTML(true);
$mail->Subject = 'Here is an email test';
$mail->Body = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
try {
// Send
$mail->send();
echo 'Message has been sent';
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
Im try use ssl, other ports and manage domain dns.