title: How to deal with self-signed TLS certificates in Laravel's SMTP driver?
body: <p>I'm trying to send an email with this configuration:</p>
  
  <p>
  
  <pre><code>return [
  
      'driver'     =&gt; 'smtp',
  
      'host'       =&gt; 'mail.mydomain.com',
  
      'port'       =&gt; 26,
  
      'from'       =&gt; ['address' =&gt; 'mailer@mydomain.com', 'name' =&gt; 'Mailer'],
  
      'encryption' =&gt; 'tls',
  
      'username'   =&gt; env('MAIL_USERNAME'),
  
      'password'   =&gt; env('MAIL_PASSWORD'),
  
      'sendmail'   =&gt; '/usr/sbin/sendmail -bs',
  
      'pretend'    =&gt; false,
  
  ];
  </code></pre>
  
  <p>When I submit the form I receive this erorr:</p>
  
  <pre><code>ErrorException in StreamBuffer.php line 95:
  stream_socket_enable_crypto(): SSL operation failed with code 1.
  OpenSSL Error messages:
  error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
  </code></pre>
  
  <p>I found this solution where people seems to have solved the problem with the same library but I cant manage to solve it in Laravel.</p>
  
  <p><a href="https://github.com/PHPMailer/PHPMailer/issues/368" rel="noreferrer">https://github.com/PHPMailer/PHPMailer/issues/368</a></p>