disable opportunistic TLS

This commit is contained in:
Asif Bacchus 2020-07-28 12:38:40 -06:00
parent e97da63d0b
commit 8ca417d808
1 changed files with 4 additions and 1 deletions

View File

@ -29,13 +29,16 @@ function sendEmail($timeout, $hostname, $usePort, $useEncryption, $username, $pa
$mail->SMTPAuth = true; $mail->SMTPAuth = true;
$mail->Username = $username; $mail->Username = $username;
$mail->Password = $password; $mail->Password = $password;
$mail->Port = $usePort;
// encryption setting // encryption setting
if ($useEncryption === 'ssl'){ if ($useEncryption === 'ssl'){
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;
} elseif ($useEncryption === 'starttls'){ } elseif ($useEncryption === 'starttls'){
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
} elseif ($useEncryption === 'none'){
$mail->SMTPSecure = false;
$mail->SMTPAutoTLS = false;
} }
$mail->Port = $usePort;
// recipients // recipients
$mail->setFrom($replyTo); $mail->setFrom($replyTo);