/** * Send a multi-part HTML email. * * @return bool */ function sendHTML($to, $from, $subject, $htmlContent, $attachedFiles = false, $customheaders = false, $plainContent = false, $inlineImages = false) { if (parent::sendHTML($to, $from, $subject, $htmlContent, $attachedFiles = false, $customheaders = false, $plainContent = false, $inlineImages = false)) { $log = new MailLog(); $log->To = $to; $log->From = $from; $log->Subject = $subject; $log->Body = $htmlContent; $log->Date = date('Y-m-d H:i:s'); $log->write(); } else { throw new Exception("Mail not accepted for delivery to {$to}"); } }