* 'subtype' - (string) The MIME subtype
*
* The array MAY contain the following information:
+ * 'contents' - (string) The contents of the part.
* 'disposition' - (string) The disposition type of the part (e.g.
* 'attachment', 'inline').
* 'dparameters' - (array) Attribute/value pairs from the part's
$ob->setTransferEncoding($data['encoding']);
}
+ if (isset($data['contents'])) {
+ $ob->setContents($data['contents'], $ob->getTransferEncoding());
+ $ob->transferDecodeContents();
+ }
+
if (isset($data['disposition'])) {
$ob->setDisposition($data['disposition']);
if (!empty($data['dparameters'])) {
}
/* Get file size (if 'body' text is set). */
- if (isset($ob->body) &&
- ($part['type'] != 'message') &&
- ($part['subtype'] != 'rfc822')) {
- /* Mail_mimeDecode puts an extra linebreak at the end of body
- * text. */
- $size = strlen(str_replace(array("\r\n", "\n"), array("\n", "\r\n"), $ob->body)) - 2;
- $part['size'] = ($size < 0) ? 0 : $size;
+ if (isset($ob->body)) {
+ $part['contents'] = $ob->body;
+ if (($part['type'] != 'message') &&
+ ($part['subtype'] != 'rfc822')) {
+ /* Mail_mimeDecode puts an extra linebreak at the end of body
+ * text. */
+ $size = strlen(str_replace(array("\r\n", "\n"), array("\n", "\r\n"), $ob->body)) - 2;
+ $part['size'] = ($size < 0) ? 0 : $size;
+ }
}
/* Process parts also. */