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'])) {
|
if (!empty($_ENV['MAIL_HOST'])) {
|
||||||
$mailer->Mailer = 'smtp';
|
$mailer->Mailer = 'smtp';
|
||||||
$mailer->Host = $_ENV['MAIL_HOST'];
|
$mailer->Host = $_ENV['MAIL_HOST'];
|
||||||
$mailer->Port = !empty($_ENV['MAIL_PORT']) ? $_ENV['MAIL_PORT'] : 25;
|
$mailer->Port = !empty($_ENV['MAIL_PORT']) ? $_ENV['MAIL_PORT'] : 587;
|
||||||
$mailer->SMTPSecure = !empty($_ENV['MAIL_SECURE']) ? $_ENV['MAIL_SECURE'] : '';
|
|
||||||
|
$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'])) {
|
if (!empty($_ENV['MAIL_USER'])) {
|
||||||
$mailer->SMTPAuth = true;
|
$mailer->SMTPAuth = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user