Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rayhanuddin2019/9790b6a703a91a575e7f8774880b3c6c to your computer and use it in GitHub Desktop.
Save rayhanuddin2019/9790b6a703a91a575e7f8774880b3c6c to your computer and use it in GitHub Desktop.
WP Mail SMTP: when using SMTP mailer - disable SSL verify on PHP 5.6+
<?php
add_filter('wp_mail_smtp_custom_options', function( $phpmailer ) {
$phpmailer->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
return $phpmailer;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment