public static function createFromMessage($message, $boundary, $EOL = Zend_Mime::LINEEND)
    {
        // require_once 'Zend/Mime/Decode.php';
        $parts = Zend_Mime_Decode::splitMessageStruct($message, $boundary, $EOL);

        $res = new self();
        foreach ($parts as $part) {
            // now we build a new MimePart for the current Message Part:
            $newPart = new Zend_Mime_Part($part['body']);
            foreach ($part['header'] as $key => $value) {
                /**
                 * @todo check for characterset and filename
                 */
                switch(strtolower($key)) {
                    case 'content-type':
                        $newPart->type = $value;
                        break;
                    case 'content-transfer-encoding':
                        $newPart->encoding = $value;
                        break;
                    case 'content-id':
                        $newPart->id = trim($value,'<>');
                        break;
                    case 'content-disposition':
                        $newPart->disposition = $value;
                        break;
                    case 'content-description':
                        $newPart->description = $value;
                        break;
                    case 'content-location':
                        $newPart->location = $value;
                        break;
                    case 'content-language':
                        $newPart->language = $value;
                        break;
                    default:
                        throw new Zend_Exception('Unknown header ignored for MimePart:' . $key);
                }
            }
            $res->addPart($newPart);
        }
        return $res;
    }
public static function createFromMessage($message, $boundary, $EOL = Zend_Mime::LINEEND)
    {
        // require_once 'Zend/Mime/Decode.php';
        $parts = Zend_Mime_Decode::splitMessageStruct($message, $boundary, $EOL);

        $res = new self();
        foreach ($parts as $part) {
            // now we build a new MimePart for the current Message Part:
            $newPart = new Zend_Mime_Part($part['body']);
            foreach ($part['header'] as $key => $value) {
                /**
                 * @todo check for characterset and filename
                 */
                switch(strtolower($key)) {
                    case 'content-type':
                        $newPart->type = $value;
                        break;
                    case 'content-transfer-encoding':
                        $newPart->encoding = $value;
                        break;
                    case 'content-id':
                        $newPart->id = trim($value,'<>');
                        break;
                    case 'content-disposition':
                        $newPart->disposition = $value;
                        break;
                    case 'content-description':
                        $newPart->description = $value;
                        break;
                    case 'content-location':
                        $newPart->location = $value;
                        break;
                    case 'content-language':
                        $newPart->language = $value;
                        break;
                    default:
                        throw new Zend_Exception('Unknown header ignored for MimePart:' . $key);
                }
            }
            $res->addPart($newPart);
        }
        return $res;
    }
public static function createFromMessage ( $ message , $ boundary , $ EOL = Zend_Mime :: LINEEND ) { // require_once 'Zend/Mime/Decode.php'; $ parts = Zend_Mime_Decode :: splitMessageStruct ( $ message , $ boundary , $ EOL ) ; $ res = new self ( ) ; foreach ( $ parts as $ part ) { // now we build a new MimePart for the current Message Part: $ newPart = new Zend_Mime_Part ( $ part [ 'body' ] ) ; foreach ( $ part [ 'header' ] as $ key => $ value ) { /**
                 * @todo check for characterset and filename
                 */ switch ( strtolower ( $ key ) ) { case 'content-type' : $ newPart -> type = $ value ; break ; case 'content-transfer-encoding' : $ newPart -> encoding = $ value ; break ; case 'content-id' : $ newPart -> id = trim ( $ value , '<>' ) ; break ; case 'content-disposition' : $ newPart -> disposition = $ value ; break ; case 'content-description' : $ newPart -> description = $ value ; break ; case 'content-location' : $ newPart -> location = $ value ; break ; case 'content-language' : $ newPart -> language = $ value ; break ; default : throw new Zend_Exception ( 'Unknown header ignored for MimePart:' . $ key ) ; } } $ res -> addPart ( $ newPart ) ; } return $ res ; }
Decodes a MIME encoded string and returns a Zend_Mime_Message object with
all the MIME parts set according to the given string

@param string $message
@param string $boundary
@param string $EOL EOL string; defaults to {@link Zend_Mime::LINEEND}
@return Zend_Mime_Message
Decodes a MIME encoded string and returns a Zend_Mime_Message object with all the MIME parts set according to the given string