title: PHPMailer: Password command failed: 534-5.7.14
body: <pre><code>function send_mail($message, $subject)
  {
      if (array_key_exists('resume', $_FILES))
      {
          $uploadfile = tempnam(sys_get_temp_dir(), sha1($_FILES['resume']['name']));
          if (move_uploaded_file($_FILES['resume']['tmp_name'], $uploadfile))
          {
             require './PHPMailer/PHPMailerAutoload.php';
             $mail              = new PHPMailer;
             $mail-&gt;isSMTP();
             $mail-&gt;SMTPDebug   = 1;
             $mail-&gt;Debugoutput = 'html';
             $mail-&gt;Host        = 'smtp.gmail.com';
             $mail-&gt;Port        = 587;
             $mail-&gt;SMTPSecure = 'tls';            
             $mail-&gt;SMTPAuth    = true;
             $mail-&gt;Username    = "abc@gmail.com";
             $mail-&gt;Password    = "XXXX";
             $mail-&gt;SetFrom('abc@gmail.com', 'ABC');
             $mail-&gt;AddAddress('abc@gmail.com');
             $mail-&gt;Subject = $subject;
             $mail-&gt;MsgHTML($message);
             $mail-&gt;AltBody = 'This is a plain-text message body';
             $mail-&gt;addAttachment($uploadfile);
  
             if ($mail-&gt;Send())
             {
                 echo "&lt;script&gt;alert('Your application is sent successfully. Our recruitment team will get in touch with you soon.');&lt;/script&gt;";
             }
             else
             {
                 echo "Mailer Error: " . $mail-&gt;ErrorInfo;
  
             }
         }
         else
         {
             echo 'Failed to move file to ' . $uploadfile;
         }
     }
  </code></pre>
  
  <p>}</p>
  
  <p>I am getting below mentioned Error:</p>
  
  <pre><code>CLIENT -&gt; SERVER: EHLO localhost
  CLIENT -&gt; SERVER: STARTTLS
  CLIENT -&gt; SERVER: EHLO localhost
  CLIENT -&gt; SERVER: AUTH LOGIN
  CLIENT -&gt; SERVER: ZGV0ZWN0aW9uaW5zdHJ1bWVudEBnbWFpbC5jb20=
  CLIENT -&gt; SERVER: ZGV0ZWN0aW9uaW5kaWE=
  SMTP ERROR: Password command failed: 534-5.7.14          &lt;https://accounts.google.com/signin/continue?sarp=1&amp;scc=1&amp;plt=AKgnsbuk534-5.7.14 PHxasqAG-1Yi0Ij1bFvZdQIBCbXiwU2i-qOUAnhhTN-mHhCHRat1ivgXGVmBuQTk0cJTl2534-5.7.14 7kvt6yrXWWs9R8Rz1mxkje545Mg0F7Xx3Cl1VTW33gDBxGfcVfR-pIVPd1SIqMHWdICkLz534-5.7.14 pPL3_DNms_IS8jJkz3Eo3MH91Yq1OU3XUV1EXzfxaUA7xbYyK9jbwM1XVvVQ-NqqYYKCMY534-5.7.14 uNWA9kWIDl_XXYWrNNP6_cCiWomH8&gt; Please log in via your web browser and534-5.7.14 then try again.534-5.7.14 Learn more at534 5.7.14 https://support.google.com/mail/answer/78754 bb5sm14055457pac.21 - gsmtp
  </code></pre>
  
  <p>SMTP Error: Could not authenticate.
  CLIENT -> SERVER: QUIT
  SMTP connect() failed. <a href="https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting" rel="nofollow">https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting</a>
  Mailer Error: SMTP connect() failed. </p>