From ecc1c6649a52cc26b8e16326e88cbbd4116a0f5f Mon Sep 17 00:00:00 2001 From: wilhelch <34109428+wilhelch@users.noreply.github.com> Date: Mon, 14 Jun 2021 15:35:02 -0600 Subject: [PATCH] Fixed SMTPAutoTLS Default (#1129) PHPMailer will always try to connect to an SMTP server via TLS by default regardless of the SMTPSecure Setting. Added a check to set SMTPAutoTLS to false when email_smtp_security is empty. --- src/includes/functions.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/includes/functions.inc.php b/src/includes/functions.inc.php index 9df630f8..bff7dc6b 100644 --- a/src/includes/functions.inc.php +++ b/src/includes/functions.inc.php @@ -603,7 +603,9 @@ namespace { $phpmailer->Host = psm_get_conf('email_smtp_host'); $phpmailer->Port = (int)psm_get_conf('email_smtp_port'); $phpmailer->SMTPSecure = psm_get_conf('email_smtp_security'); - + if (psm_get_conf('email_smtp_security') == ''){ + $phpmailer->SMTPAutoTLS = false; + } $smtp_user = psm_get_conf('email_smtp_username'); $smtp_pass = psm_password_decrypt( psm_get_conf('password_encrypt_key'),