title: Laravel 5.6 sent email
body: <p>I am trying to sent an email using laravel 5.6 but I fail.</p>
  
  <p>In my .env file I put my private gmail, so that all mails are sent to this email.</p>
  
  <pre><code>MAIL_DRIVER=smtp
  MAIL_HOST=smtp.gmail.com
  MAIL_PORT=587
  MAIL_USERNAME=mymail@gmail.com
  MAIL_PASSWORD=mypassword
  MAIL_ENCRYPTION=tls
  </code></pre>
  
  <p>Further I created a Mailable class like this:</p>
  
  <pre><code>class InquirySent extends Mailable
  {
      use Queueable, SerializesModels;
  
      public $data;
  
      public function __construct($data)
      {
          $this-&gt;data = $data;
      }
  
      public function build()
      {
          return $this-&gt;from($this-&gt;data['email'])
                      -&gt;view('emails.contacts.inquiry');
      }
  }
  </code></pre>
  
  <p>I just Need to add this data to the mail which I get from a form:</p>
  
  <pre><code>array:3 [
    "name" =&gt; "foo"
    "email" =&gt; "test@gmail.com"
    "phoneNumber" =&gt; "16547613247805"
  ]
  </code></pre>
  
  <p>In my Controller I have following function to sent the mail:</p>
  
  <pre><code>public function sent(ContactRequest $request)
  {
      $data = $request-&gt;all();
  
      Mail::to(env('MAIL_USERNAME'))-&gt;send(new InquirySent($data));
  }
  </code></pre>
  
  <p>The error message:</p>
  
  <pre><code>{,…}
  exception
  :
  "ErrorException"
  file
  :
  "D:\laragon\www\tim\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\StreamBuffer.php"
  line
  :
  94
  message
  :
  "stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:↵error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed"
  trace
  :
  [{function: "handleError", class: "Illuminate\Foundation\Bootstrap\HandleExceptions", type: "-&gt;"},…]
  </code></pre>