public function sendMail($strSubject, $strHtmlBody, $strSender, $arrRecipients) { $strReturn = ""; //*** Build the e-mail. $strTextBody = str_replace("<br /> ", "<br />", $strHtmlBody); $strTextBody = str_replace("<br />", "\n", $strTextBody); $strTextBody = str_replace(" ", "", $strTextBody); $strTextBody = strip_tags($strTextBody); $strTextBody = html_entity_decode($strTextBody, ENT_COMPAT, "UTF-8"); //*** Send the email. $objMail = new htmlMimeMail5(); $objMail->setHTMLEncoding(new Base64Encoding()); $objMail->setTextCharset("utf-8"); $objMail->setHTMLCharset("utf-8"); $objMail->setHeadCharset("utf-8"); $objMail->setFrom($strSender); $objMail->setSubject($strSubject); $objMail->setText($strTextBody); $objMail->setHTML($strHtmlBody); if (!$objMail->send($arrRecipients)) { $strReturn = $objMail->errors; } return $strReturn; }