From 0c88c36eaa011bfd4685fabd19d92e387e0a7e53 Mon Sep 17 00:00:00 2001 From: Thomas Skerbis Date: Sun, 1 Mar 2020 11:52:05 +0100 Subject: [PATCH] PHPMailer :: Debug-Output im Panel ausgeben (#3380) --- redaxo/src/addons/phpmailer/pages/checkmail.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/redaxo/src/addons/phpmailer/pages/checkmail.php b/redaxo/src/addons/phpmailer/pages/checkmail.php index 2d8d8123da..6805f282aa 100644 --- a/redaxo/src/addons/phpmailer/pages/checkmail.php +++ b/redaxo/src/addons/phpmailer/pages/checkmail.php @@ -9,7 +9,7 @@ $addon = rex_addon::get('phpmailer'); -$content = $smtpinfo = ''; +$content = $smtpinfo = $mailerDebug = ''; $emptymail = true; $date = new DateTime(); if ('' == $addon->getConfig('from') || '' == $addon->getConfig('test_address')) { @@ -45,6 +45,9 @@ $mail->Body .= "\nMailer: " . $addon->getConfig('mailer') . $devider.$security_mode; $mail->Body .= "\n". $addon->i18n('checkmail_domain_note'). "\n". $devider; + $mail->Debugoutput = static function ($str, $level) use (&$mailerDebug) { + $mailerDebug .= date('Y-m-d H:i:s', time()).' '.nl2br($str); + }; if (!$mail->send()) { $content .= '
'; @@ -64,6 +67,6 @@ } $fragment = new rex_fragment(); $fragment->setVar('title', $addon->i18n('checkmail_headline')); -$fragment->setVar('body', $content, false); +$fragment->setVar('body', $content.$mailerDebug, false); $out = $fragment->parse('core/page/section.php'); echo $out;