Copied!

Parses a mail mime message into its component parts. To invoke, call {@see MailMimeParser::parse()}.

CloneableInstantiable
Methods
public __construct(ZBateson\MailMimeParser\Parser\PartBuilderFactory $pbf, ZBateson\MailMimeParser\Message\Factory\PartHeaderContainerFactory $phcf, ZBateson\MailMimeParser\Parser\ParserManagerService $pm, ZBateson\MailMimeParser\Parser\HeaderParserService $hp)
public parse(Psr\Http\Message\StreamInterface $stream) : ZBateson\MailMimeParser\IMessage
 

Parses the passed stream into an {@see ZBateson\MailMimeParser\IMessage} object and returns it.

  • param \StreamInterface $stream the stream to parse the message from
public static readLine( $handle) : string|false
 

Convenience method to read a line of up to 4096 characters from the passed resource handle.

If the line is larger than 4096 characters, the remaining characters in the line are read and discarded, and only the first 4096 characters are returned.

  • param resource $handle
  • return string|false the read line or false on EOF or on error.
Properties
protected ZBateson\MailMimeParser\Parser\HeaderParserService $headerParser
 
  • var \HeaderParserService To parse the headers into a PartHeaderContainer.
protected ZBateson\MailMimeParser\Parser\ParserManagerService $parserManager
 
  • var \ParserManagerService To figure out what parser is responsible for parsing a message.
protected ZBateson\MailMimeParser\Parser\PartBuilderFactory $partBuilderFactory
 
  • var \PartBuilderFactory To create a PartBuilder representing this message, and to pass it to ParserManager.
protected ZBateson\MailMimeParser\Message\Factory\PartHeaderContainerFactory $partHeaderContainerFactory
 
  • var \PartHeaderContainerFactory To create a container to read the message's headers into.
Methods
public static readLine( $handle) : string|false
 

Convenience method to read a line of up to 4096 characters from the passed resource handle.

If the line is larger than 4096 characters, the remaining characters in the line are read and discarded, and only the first 4096 characters are returned.

  • param resource $handle
  • return string|false the read line or false on EOF or on error.
© 2025 Bruce Wells
Search Namespaces \ Classes
Configuration