private function createMailBody() { $email = new HTML_Page(); $email->setTitle(ucwords($this->template)); $email->setMetaData("content-type", "text/html; charset=utf-8", true); $email->setMetaData("Content-Language", "english"); if ($this->css) { $email->addStyleDeclaration($this->css); } $email->xmlProlog = false; switch ($this->email_type) { case 'html': $email->addBodyContent($this->mail_body); break; case 'plain': $email->addBodyContent(html_entity_decode(strip_tags($this->mail_body), ENT_QUOTES, 'UTF-8')); break; } return $email->toHTML(); }