title: I'm trying to send email through a contact form
body: <p>Email error </p>
  
  <p><strong>Swift_TransportException in AbstractSmtpTransport.php line 383:
  Expected response code 250 but got code "530", with message "530 5.7.1 Authentication required
  "</strong>
  so far this is my 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; 'hello@example.com',
          'name' =&gt; 'Example',
      ],
      'encryption' =&gt; env('MAIL_ENCRYPTION', 'tls'),
      'username' =&gt; env('MAIL_USERNAME'),
      'password' =&gt; env('MAIL_PASSWORD'),
      'sendmail' =&gt; '/usr/sbin/sendmail -bs',
  
  ];
  </code></pre>
  
  <p>This is my controller</p>
  
  <pre><code>public function contactstore(Request $request) 
      {
  
          $data = array_map('trim', $request-&gt;all());
          $rules = [
              'email' =&gt; 'required | email',
              'name' =&gt; 'required',
              'msg' =&gt; 'required | min:8',
          ];
          $validator = Validator::make($data, $rules);
          if ($validator-&gt;fails()) {
           return redirect()-&gt;back()-&gt;withErrors($validator)-&gt;withInput()-&gt;with('error', 'Validation Error.');
          }
          else {
              $data = [
                  'from' =&gt; 'quizmumbai@gmail.com',
                  'name' =&gt; $data['name'],
                  'email' =&gt; $data['email'],
                  'msg' =&gt; $data['msg'],
                  'view_name' =&gt; 'pages.email.querymail',
                  'to' =&gt; 'yogesh696ksingh@gmail.com',
                  'subject' =&gt; 'Event Query for TML 2017',
                  'timestamp' =&gt; date('j/M/Y', time()),
              ];
              Mail::send($data['view_name'], $data, function ($message) use ($data) {
                  $message-&gt;from($data['from'], $data['name']);
                  $message-&gt;to($data['to'])-&gt;subject($data['subject']);
              });
              if (count(Mail::failures()) &gt; 0) {
                  return redirect()-&gt;back()-&gt;with('error', 'Cannot send mail');
              }
              else return redirect()-&gt;back()-&gt;with('success', 'We will get back to you shortly')-&gt;with('message','Thanks for');
          }
      }
  </code></pre>
  
  <p><strong>is it because i'm trying on local server?</strong></p>