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;