Note that there are some explanatory texts on larger screens.

plurals
  1. PO"SMTP Error: Could not authenticate" in PHPMailer
    text
    copied!<p>I'm using PHPMailer in a Simple Script For Send Email's Through Gmail, and I'm getting an "Unknown Error" (At least for me!):</p> <blockquote> <p>SMTP Error: Could not authenticate. Error: SMTP Error: Could not authenticate.</p> <p>SMTP server error: 5.7.1 Username and Password not accepted. Learn more at 535 5.7.1 <a href="http://mail.google.com/support/bin/answer.py?answer=14257" rel="noreferrer">http://mail.google.com/support/bin/answer.py?answer=14257</a> p38sm2467302ybk.16</p> </blockquote> <p>I've read about Configure OpenSSL For SSL/TLS Connections, and I did it. Apache And PHP Are properly-Configured (With OpenSSL extension Running in PHP and mod_ssl running in Apache 2.2.16).</p> <p>This is The PHP Script:</p> <pre><code> &lt;?php require_once ("PHPMailer\class.phpmailer.php"); $Correo = new PHPMailer(); $Correo-&gt;IsSMTP(); $Correo-&gt;SMTPAuth = true; $Correo-&gt;SMTPSecure = "tls"; $Correo-&gt;Host = "smtp.gmail.com"; $Correo-&gt;Port = 587; $Correo-&gt;UserName = "foo@gmail.com"; $Correo-&gt;Password = "gmailpassword"; $Correo-&gt;SetFrom('foo@gmail.com','De Yo'); $Correo-&gt;FromName = "From"; $Correo-&gt;AddAddress("bar@hotmail.com"); $Correo-&gt;Subject = "Prueba con PHPMailer"; $Correo-&gt;Body = "&lt;H3&gt;Bienvenido! Esto Funciona!&lt;/H3&gt;"; $Correo-&gt;IsHTML (true); if (!$Correo-&gt;Send()) { echo "Error: $Correo-&gt;ErrorInfo"; } else { echo "Message Sent!"; } ?&gt; </code></pre> <p>The Username and Password are OK, And I tried in Thunderbird, without any problem. I've also Used SSL Authentication and Port 465, getting the same Error. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload