mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-05 07:20:58 +08:00
smtp setting add encryption
This commit is contained in:
@@ -1421,7 +1421,11 @@ 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'], $setting['smtpport'] == 465 ? 'ssl' : null))
|
||||
$encryption = null;
|
||||
if (isset($setting['encryption']) && in_array($setting['encryption'], ['ssl', 'tls'])) {
|
||||
$encryption = $setting['encryption'];
|
||||
}
|
||||
$transport = (new Swift_SmtpTransport($setting['smtpaddress'], $setting['smtpport'], $encryption))
|
||||
->setUsername($setting['accountname'])
|
||||
->setPassword($setting['accountpassword'])
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user