title: PHPMailer - SMTP ERROR: Password command failed when send mail from my server
body: <p>I have used phpmailer() concept to send mail to users from my shared server using php script, but I'm not able to send even though everything is right in my script according to phpmailer code.</p>
  
  <p><strong>My code like this:</strong> </p>
  
  <pre><code>  $message = " This is testing message from my server";
  
    $mail = new PHPMailer(); // create a new object
    $mail-&gt;IsSMTP(); // enable SMTP
    $mail-&gt;Host = "smtp.gmail.com";
    $mail-&gt;SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
    $mail-&gt;SMTPAuth = true; // authentication enabled
    $mail-&gt;SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail
    $mail-&gt;Port = 465; // or 587
    $mail-&gt;IsHTML(true);
    $mail-&gt;Username = "moorthi.mrk10@gmail.com"; // My gmail username
    $mail-&gt;Password = "************"; // My Gmail Password
    $mail-&gt;SetFrom("moorthi.mrk10@gmail.com");
    $mail-&gt;Subject = "Test Mail from my Server";
    $mail-&gt;Body = $message;
    $mail-&gt;AddAddress($email);
     if($mail-&gt;Send())
        {
      print json_encode("SUCCESS");
  }
  else
  {
      echo "Mailer Error: " . $mail-&gt;ErrorInfo;
  
  }
  </code></pre>
  
  <p><strong>Note:</strong>  I have used " GMail " as  my SMTP server and SMTPSecure is  " ssl " and port is "465" and username &amp; passwords are my GMail username &amp; password</p>
  
  <p>I used VPS shared server and I kept my php script on that server.</p>
  
  <p>I think there is no problem in my php script and I don't know why it doesn't work.</p>
  
  <p><strong>I got the ERROR like this.</strong></p>
  
  <pre><code>  2014-02-21 12:30:11   CLIENT -&gt; SERVER: EHLO jkcorporates.com
    2014-02-21 12:30:11   CLIENT -&gt; SERVER: AUTH LOGIN
    2014-02-21 12:30:11   CLIENT -&gt; SERVER: bW9vcnRoaS5tcmsxMEBnbWFpbC5jb20=
    2014-02-21 12:30:11   CLIENT -&gt; SERVER: OTk0MTI0MTE0MA==
    2014-02-21 12:30:11   SMTP ERROR: Password command failed: 534-5.7.14 
    534-5.7.14 i-_eumA&gt; Please log in via your web browser and then try again.
    534 5.7.14 54 k76sm17979938yho.18 - gsmtp
    2014-02-21 12:30:11   CLIENT -&gt; SERVER: QUIT
    " The ERROR is  "  SMTP connect() failed.
  </code></pre>
  
  <p>Please give some solution for that.<br/>
  Thanks in Advance.</p>
  
  <p><strong>Remember:</strong> I use Shared Server Name 'VPS.mydomain.com' and I want to use GMail as my SMTP server to send mail to users.</p>