_mail = $mail; $this->header = $header; $this->footer = $footer; } public function shutdown() { // Check for events if (!empty($this->events)) { // Add header, cast as string in case non-string set $body = (string) $this->header; // Add each event and apply the format foreach ($this->events as $event) { $body .= $this->_formatter->format($event); } // Add footer, cast as string in case non-string set $body .= (string) $this->footer; // Set mail to alterative miltipart $this->_mail->setType(Zend_Mime::MULTIPART_ALTERNATIVE); // Add body to mail $this->_mail->setBodyHtml($this->_mail->getBodyHtml(true) . $body); $this->_mail->setBodyText($this->_mail->getBodyText(true) . strip_tags($body)); // Send e-mail $this->_mail->send(); } // Call parent, will set shutdown to true parent::shutdown(); } } ?>