title: PHPmailer works on localhost but not work on heroku
body: <p>PHPMailer works at localhost phpmyadmin, but not work after I deployed on heroku, It seems that PHPMailer has authenticate problem on heroku. Anyone knows the reason?    </p>
  
  <pre><code>$to = 'xxx@gmail.com';
  $subject = 'Aliens Abducted Me - Abduction Report';
  $msg = "$name was abducted $when_it_happened and was gone for $how_long.\n" .
  "Number of aliens: $how_many\n" .
  "Alien description: $alien_description\n" .
  "What they did: $what_they_did\n" .
  "Fang spotted: $fang_spotted\n" .
  "Other comments: $other";
  
  $mail = new PHPMailer();
  $mail-&gt;  SMTPDebug=2;
  $mail -&gt;  isSMTP();
  $mail -&gt;  Host='smtp.gmail.com';
  $mail -&gt;  SMTPAuth =true;
  $mail -&gt;  Username='xxx@gmail.com';
  $mail -&gt;  Password= 'correct password';
  $mail -&gt;  SMTPSecure ='tls';
  $mail -&gt;  Port =587;
  
  $mail -&gt;  setFrom($to);
  $mail -&gt;  addAddress($to);
  
  $mail -&gt;  addReplyTo($to);
  $mail -&gt;  Subject=$subject;
  $mail -&gt;  Body=$msg;
  $mail -&gt;  send();
  </code></pre>
  
  <p>And this is the error I got</p>
  
  <pre><code>2018-01-29 23:50:50 SERVER -&gt; CLIENT: 220 smtp.gmail.com ESMTP                      y29sm10762113qtk.47 - gsmtp
  2018-01-29 23:50:50 CLIENT -&gt; SERVER: EHLO immense-bayou-46149.herokuapp.com
  2018-01-29 23:50:50 SERVER -&gt; CLIENT: 250-smtp.gmail.com at your service, [54.158.107.41]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8
  2018-01-29 23:50:50 CLIENT -&gt; SERVER: STARTTLS
  2018-01-29 23:50:50 SERVER -&gt; CLIENT: 220 2.0.0 Ready to start TLS
  2018-01-29 23:50:50 CLIENT -&gt; SERVER: EHLO immense-bayou-46149.herokuapp.com
  2018-01-29 23:50:50 SERVER -&gt; CLIENT: 250-smtp.gmail.com at your service, [54.158.107.41]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8
  2018-01-29 23:50:50 CLIENT -&gt; SERVER: AUTH LOGIN
  2018-01-29 23:50:50 SERVER -&gt; CLIENT: 334 VXNlcm5hbWU6
  2018-01-29 23:50:50 CLIENT -&gt; SERVER: &lt;credentials hidden&gt;
  2018-01-29 23:50:50 SERVER -&gt; CLIENT: 334 UGFzc3dvcmQ6
  2018-01-29 23:50:50 CLIENT -&gt; SERVER: &lt;credentials hidden&gt;
  2018-01-29 23:50:50 SERVER -&gt; CLIENT: 534-5.7.14 &lt;https://accounts.google.com/signin/continue?sarp=1&amp;scc=1&amp;plt=AKgnsbty534-5.7.14 OxYqa_vgUvCRSPkrtCYvPqBkjM-c0OPhKwgtdEA-4Du9zmkqJK4-wc6EnlEwORPnhd5VeD534-5.7.14 nGYK31F2CT1owGvIlWvSuyfXZ7YYqHnRK7y8HCRQR3OmDf9VC1YbXjy2lfanNuSZq1NLMB534-5.7.14 X1F27an8Z_tB7u9-an0ree4tmC6TUr6TuUnmxaybqouLZDiTGy1coPfbeD4JLr0CL59SSY534-5.7.14 U-Qigx5DTQIaZ8H0onzz3s9E-sLpg&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 y29sm10762113qtk.47 - gsmtp
  2018-01-29 23:50:50 SMTP ERROR: Password command failed: 534-5.7.14 &lt;https://accounts.google.com/signin/continue?sarp=1&amp;scc=1&amp;plt=AKgnsbty534-5.7.14 OxYqa_vgUvCRSPkrtCYvPqBkjM-c0OPhKwgtdEA-4Du9zmkqJK4-wc6EnlEwORPnhd5VeD534-5.7.14 nGYK31F2CT1owGvIlWvSuyfXZ7YYqHnRK7y8HCRQR3OmDf9VC1YbXjy2lfanNuSZq1NLMB534-5.7.14 X1F27an8Z_tB7u9-an0ree4tmC6TUr6TuUnmxaybqouLZDiTGy1coPfbeD4JLr0CL59SSY534-5.7.14 U-Qigx5DTQIaZ8H0onzz3s9E-sLpg&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 y29sm10762113qtk.47 - gsmtp
  SMTP Error: Could not authenticate.
  2018-01-29 23:50:50 CLIENT -&gt; SERVER: QUIT
  2018-01-29 23:50:50 SERVER -&gt; CLIENT: 221 2.0.0 closing connection y29sm10762113qtk.47 - gsmtp
  SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
  </code></pre>