diff --git a/src/Services/Mail/Smtp.php b/src/Services/Mail/Smtp.php index 808d08fad..f8e7446c4 100755 --- a/src/Services/Mail/Smtp.php +++ b/src/Services/Mail/Smtp.php @@ -59,14 +59,13 @@ final class Smtp extends Base if (!$mail->send()) { $sError = $mail->ErrorInfo; + $oMailLog = new ModelMailLog(); + $oMailLog->to = $to; + $oMailLog->title = $subject; + $oMailLog->date = date("Y-m-d"); + $oMailLog->error = $sError; + $oMailLog->save(); } - - $oMailLog = new ModelMailLog(); - $oMailLog->to = $to; - $oMailLog->title = $subject; - $oMailLog->date = date("Y-m-d"); - $oMailLog->error = $sError; - $oMailLog->save(); } }