New configurable: smtp_debug

This commit is contained in:
slawkens 2020-02-03 20:48:11 +01:00
parent 1a6044090a
commit 08f011eb33
2 changed files with 6 additions and 0 deletions

View File

@ -121,6 +121,7 @@ $config = array(
'smtp_user' => 'admin@example.org', 'smtp_user' => 'admin@example.org',
'smtp_pass' => '', 'smtp_pass' => '',
'smtp_secure' => '', // What kind of encryption to use on the SMTP connection. Options: '', 'ssl' or 'tls', use 'ssl' for gmail '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 (prevent spam bots)
'recaptcha_enabled' => false, // enable recaptcha verification code 'recaptcha_enabled' => false, // enable recaptcha verification code

View File

@ -859,6 +859,11 @@ function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true)
$mailer->addAddress($to); $mailer->addAddress($to);
$mailer->Body = $tmp_body; $mailer->Body = $tmp_body;
if(config('smtp_debug')) {
$mailer->SMTPDebug = 2;
$mailer->Debugoutput = 'echo';
}
$signature_plain = ''; $signature_plain = '';
if(isset($config['mail_signature']['plain'])) if(isset($config['mail_signature']['plain']))
$signature_plain = $config['mail_signature']['plain']; $signature_plain = $config['mail_signature']['plain'];