Unable to connect with STARTTLS: stream_socket_enable_crypto(): Peer certificate CN= " " did not match expected CN= ""

You can add following code in /config/mail.php for Laravel:

'stream' => [
   'ssl' => [
      'allow_self_signed' => true,
      'verify_peer' => false,
      'verify_peer_name' => false,
   ],
],

 

For PHP Mailer, You can add following code in your mail script/file:

 $mail->SMTPOptions = array (
        'ssl' => array(
            'verify_peer'  => false,
            'verify_peer_name'  => false,
            'allow_self_signed' => true));
  • Laravel, PHP Mailer
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Flash tutorials to manage control panel

My SQL A guide to creating and modifying MySQL databases in cPanel. Quality: High | Low Change...

Flash tutorials to manage email

Email Accounts Manage the email accounts associated with your domain(s). Quality: High | Low...

Where can I find cPanel tutorials?

Check cPanel docs :http://www.cpanel.net/docs/cpanel/

How do I use .html files to run SSI (Server Side Includes)?

Apache Handlers This is what you would use to specify how to treat file types. By default,...

WordPress SMTP Authentication

SMTP auth support can be added in wordpress through third party plugins. You can follow these...