I have a third party program which basically allows users to send email and then it displays it in the system. But the problem is that it is generating an output like this: I wa
PEAR::Mail_mimeDecode is a great class to decode MIME messages. Once installed, you can use it as such:
$message = new Mail_mimeDecode($text);
$params['include_bodies'] = true;
$params['decode_bodies'] = true;
$params['decode_headers'] = true;
$messageStruct = $message->decode($params);
//messageStruct is now an array representing the message
// with all the parts properly included.