From c0dbb23071abfe73d8f308448cfed900c9db699f Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Sat, 27 Feb 2021 00:28:10 +0800 Subject: [PATCH] send email use ssl encryption if port is 465 --- include/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/functions.php b/include/functions.php index c91314f6..2daa8fd2 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1420,7 +1420,7 @@ function sent_mail($to,$fromname,$fromemail,$subject,$body,$type = "confirmation $setting = get_setting('smtp'); // Create the Transport - $transport = (new Swift_SmtpTransport($setting['smtpaddress'], $setting['smtpport'])) + $transport = (new Swift_SmtpTransport($setting['smtpaddress'], $setting['smtpport'], $setting['smtpport'] == 465 ? 'ssl' : null)) ->setUsername($setting['accountname']) ->setPassword($setting['accountpassword']) ;