Upgrade to 3.5.1

This commit is contained in:
Bastian Allgeier
2021-01-19 12:20:38 +01:00
parent 8f55019e01
commit 99c36fa137
119 changed files with 2973 additions and 3707 deletions

View File

@@ -73,6 +73,24 @@ class PHPMailer extends Email
$mailer->Password = $this->transport()['password'] ?? null;
$mailer->SMTPSecure = $this->transport()['security'] ?? 'ssl';
$mailer->Port = $this->transport()['port'] ?? null;
if ($mailer->SMTPSecure === true) {
switch ($mailer->Port) {
case null:
case 587:
$mailer->SMTPSecure = 'tls';
$mailer->Port = 587;
break;
case 465:
$mailer->SMTPSecure = 'ssl';
break;
default:
throw new InvalidArgumentException(
'Could not automatically detect the "security" protocol from the ' .
'"port" option, please set it explicitly to "tls" or "ssl".'
);
}
}
}
// accessible phpMailer instance