disable opportunistic TLS

This commit is contained in:
Asif Bacchus 2020-07-28 12:38:40 -06:00
parent e97da63d0b
commit 8ca417d808

View File

@ -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);