allow starttls and smtps for mailing
This commit is contained in:
parent
66040d69db
commit
ecec258a64
@ -44,8 +44,10 @@ class Mail
|
||||
if (!empty($_ENV['MAIL_HOST'])) {
|
||||
$mailer->Mailer = 'smtp';
|
||||
$mailer->Host = $_ENV['MAIL_HOST'];
|
||||
$mailer->Port = !empty($_ENV['MAIL_PORT']) ? $_ENV['MAIL_PORT'] : 25;
|
||||
$mailer->SMTPSecure = !empty($_ENV['MAIL_SECURE']) ? $_ENV['MAIL_SECURE'] : '';
|
||||
$mailer->Port = !empty($_ENV['MAIL_PORT']) ? $_ENV['MAIL_PORT'] : 587;
|
||||
|
||||
$secureMaping = ['none' => '', 'starttls' => PHPMailer::ENCRYPTION_STARTTLS, 'smtps' => PHPMailer::ENCRYPTION_SMTPS];
|
||||
$mailer->SMTPSecure = !empty($_ENV['MAIL_SECURE']) ? $secureMaping[$_ENV['MAIL_SECURE']] : '';
|
||||
|
||||
if (!empty($_ENV['MAIL_USER'])) {
|
||||
$mailer->SMTPAuth = true;
|
||||
|
Loading…
Reference in New Issue
Block a user