Ejemplo n.º 1
0
 /**
  * @param MailMessage $paren
  * @return MailMessage
  */
 function &CreateNewTextMail($paren = null)
 {
     $newMail = new MimePart();
     if ($paren) {
         $newMail->Headers =& $paren->Headers;
     }
     $newMail->_sourceCharset = $GLOBALS[MailOutputCharset];
     if ($this->HasPlainText()) {
         $newMail->Headers->SetHeaderByName(MIMEConst_ContentType, MIMETypeConst_TextPlain . '; ' . MIMEConst_CharsetLower . '="' . $GLOBALS[MailOutputCharset] . '"');
         $newMail->SetEncodedBodyFromText($this->TextBodies->PlainTextBodyPart);
     }
     if ($this->HasHtmlText()) {
         $newMail->Headers->SetHeaderByName(MIMEConst_ContentType, MIMETypeConst_TextHtml . '; ' . MIMEConst_CharsetLower . '="' . $GLOBALS[MailOutputCharset] . '"');
         $newMail->SetEncodedBodyFromText($this->TextBodies->HtmlTextBodyPart);
     }
     return $newMail;
 }
Ejemplo n.º 2
0
 /**
  * @return MimePart
  */
 function ToHtmlMime()
 {
     $newHtmlMimePart = new MimePart();
     $newHtmlMimePart->Headers->SetHeaderByName(MIMEConst_ContentType, MIMETypeConst_TextHtml . '; ' . MIMEConst_CharsetLower . '="' . $GLOBALS[MailOutputCharset] . '"');
     $newHtmlMimePart->Headers->SetHeaderByName(MIMEConst_ContentTransferEncoding, MIMEConst_QuotedPrintable);
     /* $newHtmlMimePart->Headers->SetHeaderByName(MIMEConst_ContentTransferEncoding, MIMEConst_Base64); */
     $newHtmlMimePart->SetEncodedBodyFromText($this->HtmlTextBodyPart);
     $newHtmlMimePart->_sourceCharset = $GLOBALS[MailOutputCharset];
     return $newHtmlMimePart;
 }