From 8ca417d808fba9a3718822d9aea835da719f47d6 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Tue, 28 Jul 2020 12:38:40 -0600 Subject: [PATCH] disable opportunistic TLS --- php/PHPMailer/mailer.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/php/PHPMailer/mailer.php b/php/PHPMailer/mailer.php index 34c62dc..80cb6f5 100644 --- a/php/PHPMailer/mailer.php +++ b/php/PHPMailer/mailer.php @@ -29,13 +29,16 @@ function sendEmail($timeout, $hostname, $usePort, $useEncryption, $username, $pa $mail->SMTPAuth = true; $mail->Username = $username; $mail->Password = $password; + $mail->Port = $usePort; // encryption setting if ($useEncryption === 'ssl'){ $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; } elseif ($useEncryption === 'starttls'){ $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; + } elseif ($useEncryption === 'none'){ + $mail->SMTPSecure = false; + $mail->SMTPAutoTLS = false; } - $mail->Port = $usePort; // recipients $mail->setFrom($replyTo);