Even when encryption is set to None in the SMTP mail settings PHPMailer still performs opportunistic encryption and attempts verification of the hostname.
I've replaced line 708 in my functions.php with:
if ($config_smtp_encryption = 'None') {
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
)
);
$mail->SMTPSecure = false;
$mail->SMTPAutoTLS = false;
} else {
$mail->SMTPSecure = $config_smtp_encryption; // Enable TLS encryption, `ssl` also accepted
}
This has fixed the issue for me.
It would also be great if we can get a flag on the SMTP settings to not perform verification checks on the SMTP server and allow self signed certs for TLS/SSL.