Horde_ActiveSync_Rfc822::getMimeObject PHP Method

getMimeObject() public method

Return a Mime object representing the entire message.
public getMimeObject ( ) : Horde_Mime_Part
return Horde_Mime_Part The Mime object.
    public function getMimeObject()
    {
        $this->_stream->rewind();
        $part = Horde_Mime_Part::parseMessage($this->_stream->getString());
        $part->isBasePart(true);
        return $part;
    }

Usage Example

Example #1
0
 public function testBaseMimePart()
 {
     $fixture = file_get_contents(__DIR__ . '/fixtures/iOSMultipartAlternative.eml');
     $rfc822 = new Horde_ActiveSync_Rfc822($fixture);
     $mimepart = $rfc822->getMimeObject();
     $expected = array('multipart/alternative', 'text/plain', 'text/html');
     $this->assertEquals($expected, $mimepart->contentTypeMap());
     $this->assertEquals(1, $mimepart->findBody('plain'));
     $this->assertEquals(2, $mimepart->findBody('html'));
 }
All Usage Examples Of Horde_ActiveSync_Rfc822::getMimeObject