php - mime help plz

They have: 5,633 posts

Joined: Jan 1970

hello, ok i have a script that opens up email files and reads the body from them how would i read the body of a mime file? i have this little code:

function get_msg($file) {
$fp = fopen($file2, "rb");
$contents = fread($fp, filesize($file2));
preg_match('/

(.*)\n/', $contents ,$from);
return(explode("
(end)", $from[1]));
}

that pulls the body from liek a regular plain text email how would i do this with a mime file and php? all help is appreciated..