From 08f011eb33c5399a26ca7336ceac3e72da6e4b3e Mon Sep 17 00:00:00 2001 From: slawkens Date: Mon, 3 Feb 2020 20:48:11 +0100 Subject: [PATCH] New configurable: smtp_debug --- config.php | 1 + system/functions.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/config.php b/config.php index 67ed19d5..b4dab1b0 100644 --- a/config.php +++ b/config.php @@ -121,6 +121,7 @@ $config = array( 'smtp_user' => 'admin@example.org', 'smtp_pass' => '', 'smtp_secure' => '', // What kind of encryption to use on the SMTP connection. Options: '', 'ssl' or 'tls', use 'ssl' for gmail + 'smtp_debug' => false, // set true to debug (you will see more info in error.log) // reCAPTCHA (prevent spam bots) 'recaptcha_enabled' => false, // enable recaptcha verification code diff --git a/system/functions.php b/system/functions.php index c571ea7c..5fa343fe 100644 --- a/system/functions.php +++ b/system/functions.php @@ -859,6 +859,11 @@ function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true) $mailer->addAddress($to); $mailer->Body = $tmp_body; + if(config('smtp_debug')) { + $mailer->SMTPDebug = 2; + $mailer->Debugoutput = 'echo'; + } + $signature_plain = ''; if(isset($config['mail_signature']['plain'])) $signature_plain = $config['mail_signature']['plain'];