From 4b7611f830215e49d29bcccccac04af736f44762 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Fri, 17 Mar 2023 13:58:38 +0100 Subject: [PATCH] SMTP test in progress --- core/core.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/core.php b/core/core.php index 503fb41f..cf89e5c6 100644 --- a/core/core.php +++ b/core/core.php @@ -1118,15 +1118,19 @@ class common try { // Paramètres SMTP perso if ($this->getdata(['config', 'smtp', 'enable'])) { - //$mail->SMTPDebug = PHPMailer\PHPMailer\SMTP::DEBUG_SERVER; + $mail->SMTPDebug = PHPMailer\PHPMailer\SMTP::DEBUG_SERVER; $mail->isSMTP(); $mail->SMTPAutoTLS = false; + $mail->SMTPSecure = false; + $mail->SMTPAuth = false; $mail->Host = $this->getdata(['config', 'smtp', 'host']); $mail->Port = (int) $this->getdata(['config', 'smtp', 'port']); if ($this->getData(['config', 'smtp', 'auth'])) { + $mail->SMTPAutoTLS = true; + $mail->SMTPSecure = true; + $mail->SMTPAuth = $this->getData(['config', 'smtp', 'auth']); $mail->Username = $this->getData(['config', 'smtp', 'username']); $mail->Password = helper::decrypt($this->getData(['config', 'smtp', 'username']), $this->getData(['config', 'smtp', 'password'])); - $mail->SMTPAuth = $this->getData(['config', 'smtp', 'auth']); $mail->SMTPSecure = $this->getData(['config', 'smtp', 'secure']); } }