Răsfoiți Sursa

Add SMTP debug information

Yannick Warnier 9 ani în urmă
părinte
comite
405b2c7bdf
1 a modificat fișierele cu 9 adăugiri și 0 ștergeri
  1. 9 0
      main/inc/lib/api.lib.php

+ 9 - 0
main/inc/lib/api.lib.php

@@ -8046,6 +8046,15 @@ function api_mail_html(
     // Send the mail message.
     if (!$mail->Send()) {
         error_log('ERROR: mail not sent to '.$recipient_name.' ('.$recipient_email.') because of '.$mail->ErrorInfo.'<br />');
+        if ($mail->SMTPDebug) {
+            error_log(
+                "Connection details :: " .
+                "Protocol: " . $mail->Mailer . ' :: ' .
+                "Host/Port: " . $mail->Host . ':' . $mail->Port . ' :: ' .
+                "Authent/Open: " . ($mail->SMTPAuth?'Authent':'Open') . ' :: ' .
+                ($mail->SMTPAuth?"  User/Pass: " . $mail->Username . ':' . $mail->Password:'')
+            );
+        }
         return 0;
     }