From 74494b466ba76605c63d8c9a20a08f97556094ee Mon Sep 17 00:00:00 2001 From: cnsaturn Date: Tue, 14 Jan 2014 00:13:00 +0800 Subject: [PATCH] =?UTF-8?q?SMTP=20=E9=9D=9E=2025=20=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E7=AB=AF=E5=8F=A3=E9=82=AE=E4=BB=B6=E5=8F=91=E9=80=81=E4=BC=9A?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=EF=BC=9A=E5=A2=9E=E5=8A=A0=E5=AF=B9=20465=20?= =?UTF-8?q?SSL=20=E7=AB=AF=E5=8F=A3=E5=92=8C=20587=20TLS=20=E7=AB=AF?= =?UTF-8?q?=E5=8F=A3=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/app.function.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/app.function.php b/lib/app.function.php index ba08ad3..62023c2 100644 --- a/lib/app.function.php +++ b/lib/app.function.php @@ -811,6 +811,19 @@ function phpmailer_send_mail( $to , $subject , $body , $from , $host , $port , $mail->MsgHTML($body); $mail->AddAddress( $to ); + switch ($port) + { + case 465: + $mail->SMTPSecure = "ssl"; + break; + case 587: + $mail->SMTPSecure = 'tls'; + break; + default: + // Do nothing! + break; + } + if(!$mail->Send()) { $GLOBALS['LP_MAILER_ERROR'] = $mail->ErrorInfo;