/** * @return string */ function SetEncodedBodyFromText($body, $charset = '') { //if ($charset == '') $charset = $GLOBALS[MailDefaultCharset]; if ($charset == '') { $charset = $GLOBALS[MailInputCharset]; } $body = preg_replace('/(<meta\\s.*)(charset\\s?=)([^"\'>\\s]*)/i', '$1$2' . $GLOBALS[MailOutputCharset], $body); $body = ConvertUtils::ConvertEncoding($body, $charset, $GLOBALS[MailOutputCharset]); $ContentTransferEncoding = MIMEConst_QuotedPrintableLower; if ($ContentTransferEncoding == MIMEConst_QuotedPrintableLower) { $this->Headers->SetHeaderByName(MIMEConst_ContentTransferEncoding, MIMEConst_QuotedPrintable); $this->_body = ConvertUtils::quotedPrintableWithLinebreak($body); } elseif ($ContentTransferEncoding == MIMEConst_Base64Lower) { $this->Headers->SetHeaderByName(MIMEConst_ContentTransferEncoding, MIMEConst_Base64); $this->_body = ConvertUtils::base64WithLinebreak($body); } else { $this->_body = $body; } }