splitMessageStruct example

return;
        }

        // split content in parts         $boundary = $this->getHeaderField('content-type', 'boundary');
        if (!$boundary) {
            /** * @see Zend_Mail_Exception */
            throw new Zend_Mail_Exception('no boundary found in content type to split message');
        }
        $parts = Zend_Mime_Decode::splitMessageStruct($this->_content, $boundary);
        if ($parts === null) {
            return;
        }
        $partClass = $this->getPartClass();
        $counter = 1;
        foreach ($parts as $part) {
            $this->_parts[$counter++] = new $partClass(array('headers' => $part['header'], 'content' => $part['body']));
        }
    }

    /** * Get part of multipart message * * @param int $num number of part starting with 1 for first part * @return Zend_Mail_Part wanted part * @throws Zend_Mail_Exception */
/** * 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 */
    public static function createFromMessage($message$boundary$EOL = Zend_Mime::LINEEND)
    {
        $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':
                        
Home | Imprint | This part of the site doesn't use cookies.