Skip to content

Commit 5fcdef7

Browse files
author
Mark Guinn
committed
Merge pull request #13 from AntonyThorpe/Debugoutput
Updated EmogrifiedSmtpMailer for logging
2 parents 5be8290 + ca79e8d commit 5fcdef7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

code/EmogrifiedSmtpMailer.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,18 @@ public function sendHTML($to, $from, $subject, $htmlContent, $attachedFiles = fa
154154
}
155155
if ($level = $this->getSMTPDebug()) {
156156
$mail->SMTPDebug = $level;
157-
$mail->Debugoutput = 'html'; // HTML friendly report
157+
$mail->Debugoutput = function ($str, $level)
158+
{
159+
SS_Log::log(print_r($str, true), SS_Log::NOTICE);
160+
};
158161
}
159162

160163
// send and return
161164
if ($mail->Send()) {
162165
return array($to, $subject, $mail->Body, $customheaders);
163166
} else {
164167
if ($this->getLogfailedemail()) {
165-
SS_Log::log(new Exception(print_r($mail->ErrorInfo, true)), SS_Log::NOTICE);
168+
SS_Log::log(print_r($mail->ErrorInfo, true), SS_Log::NOTICE);
166169
}
167170
return false;
168171
}

0 commit comments

Comments
 (0)