Home / Archive / WP Mail SMTP: when using SMTP mailer – disable SSL verification
Duplicate Snippet

Embed Snippet on Your Site

WP Mail SMTP: when using SMTP mailer – disable SSL verification

This is an insecure approach and you most probably should fix your servers' SSL certificates (they shouldn't be self-signed and should be valid) instead of using this snippet.

Code Preview
php
<?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;
} );

Comments

Add a Comment