MIME :: boolean split_mail ( string mail, array &headers, array &body_parts )
Return TRUE if has been successfully split, FALSE if not. array headers format is multidimensional array ('name' => string header_name, 'value' => string header_value, 'content' => array additional). The array additional is apply only to header names that begin with "Content-" (case insensitive). array body_parts format is multidimensional array (['header_content' => array ('value' => string header_value, 'extra' => array additional), ...], 'content' => string decoded_content, ['multipart' => string multipart_order]). The string header_content contain value afther "Content-" (case insensitive). array additional format is multidimensional array (string name, string value) Example:

// standard mail message RFC2822
$m = 'From: me@addr.net'."\r\n".
     'To: my@addr.com'."\r\n".
     'Subject: test'."\r\n".
     'Content-Transfer-Encoding: base64'."\r\n".
     'Content-Type: text/plain; charset="ISO-8859-1"'."\r\n\r\n".
     base64_encode('Text message.');

$r = MIME::split_mail($m, $h, $b);

print_r($h); // print headers
print_r($b); // print body parts

See Also: MIME::split_message() [ Comments ] Last update: Sunday, December 09, 2007