Location: PHPKode > projects > EXtensible Production Suite (XPS) > xpsdev/helpers/xpm3/DOCUMENTATION/mime/split_compose.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>XPM3_MIME::split_compose()</title>
<style>
body, pre {
	font-family: Verdana;
	font-size: 10pt;
}
</style>
</head>
<body bgcolor="#f1f3f5" topmargin="10" leftmargin="14">

<pre>
XPM3_MIME :: <i>array</i> <b>split_compose</b> ( <i>string</i> content )
<hr>
Returns an array with mail message components: <i>array</i> header, <i>string</i> boundary, <i>string</i> multipart, <i>string</i> body.

Example:
<table border="0" bgcolor="white">
<tr><td>
<pre><code>
$txt = XPM3_MIME::message('Text message', 'text/plain');
$htm = XPM3_MIME::message('HTML message', 'text/html');

// compose a mail message
$msg = XPM3_MIME::compose($txt, $htm);
$dat = $msg['addheader']."\r\n\r\n".$msg['body'];
// echo $dat;

// split
$spl = XPM3_MIME::split_compose($dat);

// print result
print_r($spl);

/* will print:
Array
(
    [body] => This is a message in MIME Format. If you see this, your mail reader does not support this format.

--=_b26b0ff2f40a1a7769c6015f2218808b
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Text message
--=_b26b0ff2f40a1a7769c6015f2218808b
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

HTML message
--=_b26b0ff2f40a1a7769c6015f2218808b--
    [header] => Array
        (
            [0] => Array
                (
                    [MIME-Version] => 1.0
                )

            [1] => Array
                (
                    [Content-Type] => multipart/alternative; boundary="=_b26b0ff2f40a1a7769c6015f2218808b"
                )

        )

    [multipart] => alternative
    [boundary] => =_b26b0ff2f40a1a7769c6015f2218808b
)
*/
</code></pre>
</td></tr>
</table>

<hr color="white">

[ <a style="color: blue; text-decoration: none" href="mailto:hide@address.com?subject=Comment XPM3_MIME split_compose">Comments</a> ]

Last update: Monday, January 22, 2007

</pre>

</body>
</html>
Return current item: EXtensible Production Suite (XPS)