title: Google SMTP Not Connecting
body: <p>I have hosting with HostGator, and I am using the PHP Mailer package to connect to the google smtp server and send mail.</p>
  
  <p>Here is the part of my code that connects to the server:</p>
  
  <pre><code>$mail = new PHPMailer();
  $mail-&gt;IsSMTP();
  $mail-&gt;SMTPDebug = 1;
  $mail-&gt;CharSet="UTF-8";
  $mail-&gt;SMTPSecure = 'ssl';
  $mail-&gt;Host = 'smtp.gmail.com';
  $mail-&gt;Port = 465;
  $mail-&gt;Username = 'user';
  $mail-&gt;Password = 'pass';
  $mail-&gt;SMTPAuth = true;
  </code></pre>
  
  <p>This is the error that im getting:</p>
  
  <p><img src="https://i.stack.imgur.com/87p1F.png" alt="enter image description here"></p>
  
  <p>Perhaps google blocked me from logging in from an external server? If so, how do I permanently fix that? I am sure that my login credentials are correct. </p>