Skip to content

Commit

Permalink
PHPMailer :: Debug-Output im Panel ausgeben (#3380)
Browse files Browse the repository at this point in the history
  • Loading branch information
skerbis committed Mar 1, 2020
1 parent 95971df commit 0c88c36
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions redaxo/src/addons/phpmailer/pages/checkmail.php
Expand Up @@ -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')) {
Expand Down Expand Up @@ -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 .= '<div class="alert alert-danger">';
Expand All @@ -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;

0 comments on commit 0c88c36

Please sign in to comment.