title: Swift_TransportException Expected response code 250 but got code "535", with message "535-5.7.8 Username and Password not accepted
body: <p>I'm trying to send email using laravel 5.4 but I'm getting this error.
  I try to enable less secure application for my account but nothing seems to work for me.  this is my code:</p>
  
  <pre><code>use Mail;
  
  class UserController extends Controller{
      public function register(Request $request)
      {
          $inputs=$request-&gt;all();
          $data=$inputs;
          Mail::send('mail.ajout', $data, function($message) use ($data)
          {
              $message-&gt;from($data['email']);
              $message-&gt;subject("Nouvelle inscription");
              $message-&gt;to('myaccount@gmail.com');
          });
  
      }
  }
  </code></pre>
  
  <p>my env file:</p>
  
  <pre><code>MAIL_DRIVER=smtp
  MAIL_HOST=smtp.gmail.com
  MAIL_USERNAME= myacount@gmail.com
  MAIL_PASSWORD= mypwd
  MAIL_ENCRYPTION=tls
  </code></pre>
  
  <p>mail.php</p>
  
  <pre><code>&lt;?php
  
  return [
      'driver' =&gt; env('MAIL_DRIVER', 'smtp'),
      'host' =&gt; env('MAIL_HOST', 'smtp.mailgun.org'),
      'port' =&gt; env('MAIL_PORT', 587),
      'from' =&gt; [
          'address' =&gt; env('MAIL_FROM_ADDRESS', 'hello@example.com'),
          'name' =&gt; env('MAIL_FROM_NAME', 'Example'),
      ],  
      'encryption' =&gt; env('MAIL_ENCRYPTION', 'tls'),
      'username' =&gt; env('MAIL_USERNAME'),
      'password' =&gt; env('MAIL_PASSWORD'),
      'sendmail' =&gt; '/usr/sbin/sendmail -bs',
      'markdown' =&gt; [
          'theme' =&gt; 'default',
          'paths' =&gt; [
              resource_path('views/vendor/mail'),
          ],
      ],
  ];
  </code></pre>
  
  <p>any help please ,thanks in advance</p>