title: How to send an email to outlook in laravel 5.6?
body: <p>I want to send email to <code>outlook</code> in <code>laravel 5.6</code></p>
  
  <p><strong>.env file</strong></p>
  
  <pre><code>MAIL_DRIVER=smtp
  MAIL_HOST=smtp.office365.com
  MAIL_PORT=587
  MAIL_USERNAME=******
  MAIL_PASSWORD="******"
  MAIL_ENCRYPTION=tls
  </code></pre>
  
  <p><strong>config/mail.php</strong></p>
  
  <pre><code>'driver' =&gt; env('MAIL_DRIVER', 'smtp'),
  'host' =&gt; env('MAIL_HOST', 'smtp.office365.com'),
  'port' =&gt; env('MAIL_PORT', 587),
  
  'from' =&gt; [
      'address' =&gt; env('MAIL_FROM_ADDRESS', 'kishor.bhatt@cdscnp.com'),
      'name' =&gt; env('MAIL_FROM_NAME', 'Kishor Bhatt'),
  ],
   'encryption' =&gt; env('MAIL_ENCRYPTION', 'tls'),
   'username' =&gt; env('MAIL_USERNAME'),
  
   'password' =&gt; env('MAIL_PASSWORD'), 
  </code></pre>
  
  <p><strong>email/mail.blade.php</strong></p>
  
  <pre><code>&lt;h3&gt;You have received new email.&lt;/h3&gt;
  &lt;div&gt;
  &lt;b&gt;Name:&lt;/b&gt; {{ $name }} &lt;br&gt;
  &lt;b&gt;Email:&lt;/b&gt; {{ $email }} &lt;br&gt;
  &lt;b&gt;Phone No:&lt;/b&gt; {{ $phone }} &lt;br&gt;
  &lt;div&gt; 
  &lt;b&gt;Message:&lt;/b&gt; {{ $bodyMessage }}
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;p&gt; Send By: {{ $email }} &lt;p&gt;
  </code></pre>
  
  <p><strong>sendmail() function</strong></p>
  
  <pre><code>    $data = $request-&gt;all();
      $mail = array(
              'name' =&gt; $data['name'],
              'phone' =&gt; $data['phone'],
              'email' =&gt; $data['email'],
              'bodyMessage' =&gt; $data['message']
          );
  
          Mail::send('email.mail', $mail, function($message) use ($mail){
              $message-&gt;from($mail['email']);
              $message-&gt;to('shankar.bhatt@cdscnp.com');
              $message-&gt;subject('Query from '.$mail['name']);
          });
  
        return redirect('/contact-us')-&gt;with('flash_message_success','Thank you for your feedback. We will get back shortly.');
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <blockquote>
    <p>Failed to authenticate on SMTP server with username
    "prem.basnet@cdscnp.com" using 2 possible authenticators.
    Authenticator LOGIN returned Swift_TransportException: Expected
    response code 235 but got code "535", with message "535 5.7.3
    Authentication unsuccessful.</p>
  </blockquote>
  
  <p>How do I solve the error and send the email to outlook?</p>