0

I am using this code:

<?php
require ('PHPMailer/PHPMailerAutoload.php');
$mail = new PHPMailer;
//$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username = 'allthingsremainhere@gmail.com';
$mail->Password = 'password';
$mail->SMTPSecure = 'ssl';
$mail->Port = '465';
$mail->SetFrom('youcanreply@lishup.com', 'Reply It! - LishUp');
$mail->AddAddress('techgoeshere@gmail.com', 'Tech');
$mail->Subject  = 'First PHPMailer Message';
$mail->Body     = 'Hi! This is my first e-mail sent through PHPMailer.';

if(!$mail->send()) {
  echo 'Message was not sent.';
  echo 'Mailer error: ' . $mail->ErrorInfo;
} else {
  echo 'Message has been sent.';
}
?>

My Email and Password is alright. That's not the problem. Something is wrong with the stmp connection. In Google Account: 2Factor Authorization is off and 'Allow Less secure app' is turned on

I am using a Live Server hosted on Google Cloud. Please help me to solve this

0 Answers0