title: Laravel Failed to authenticate on SMTP server with username
body: <p>Am trying to send email by Laravel.
  But It's getting error.
  <br></p>
  
  <h1>.env file Configuration below :</h1>
  
  <pre><code>MAIL_DRIVER=smtp
  MAIL_HOST=smtp.gmail.com
  MAIL_PORT=587
  MAIL_USERNAME=myemailID@gmail.com
  MAIL_PASSWORD=******
  MAIL_ENCRYPTION=tls
  </code></pre>
  
  <h1>Controller Code Below :</h1>
  
  <pre><code> $data = array('name'=&gt;"Ripon Uddin", "body" =&gt; "Test mail");
  
      Mail::send('email', $data, function($message) {
          $message-&gt;to('ToEmailID@yahoo.com','To My Yahoo')-&gt;subject('Laravel Test Email');
          $message-&gt;from('ToFromID@gmail.com','Ripon Uddin (Laravel Lover)');
      });
  </code></pre>
  
  <p>Error gettings : </p>
  
  <blockquote>
    <p>Failed to authenticate on SMTP server with username "myEmailID@gmail.com" using 3 possible authenticators. Authenticator LOGIN returned Swift_TransportException: Expected response code 235 but got code "535", with message "535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 <a href="https://support.google.com/mail/?p=BadCredentials" rel="noreferrer">https://support.google.com/mail/?p=BadCredentials</a> r18-v6sm7406256pgv.17 - gsmtp " in </p>
  </blockquote>