public function parse($mail)
    {
        // Initial
        /** @var Part $mailPart */
        $mailPart = $this->workAroundMissingBoundary(
            $this->partFactory->getPart($mail),
            $mail
        );

        $partTreeFactory = new PartTreeFactory($this->partFactory);
        $partTree = $partTreeFactory->make($mailPart);

        /** @var Part[] $parts */
        $parts = $partTree->flattenParts();

        /** @var Part $envelopedEmail */
        $envelopedEmail = $partTree->getEnvelopedEmail();

        // Everything else
        $loggingEmails = $this->getLoggingEmails($mailPart, $parts);
        // All email addresses as a hash in the form $allEmailAddressesByField[field] = [];
        $allEmailAddressesByField = $this->getAllEmailAddresses($parts);

        return new ParsedMail(
            $mail,
            $mailPart,
            $parts,
            $loggingEmails,
            $allEmailAddressesByField,
            $envelopedEmail
        );
    }
public function parse($mail)
    {
        // Initial
        /** @var Part $mailPart */
        $mailPart = $this->workAroundMissingBoundary(
            $this->partFactory->getPart($mail),
            $mail
        );

        $partTreeFactory = new PartTreeFactory($this->partFactory);
        $partTree = $partTreeFactory->make($mailPart);

        /** @var Part[] $parts */
        $parts = $partTree->flattenParts();

        /** @var Part $envelopedEmail */
        $envelopedEmail = $partTree->getEnvelopedEmail();

        // Everything else
        $loggingEmails = $this->getLoggingEmails($mailPart, $parts);
        // All email addresses as a hash in the form $allEmailAddressesByField[field] = [];
        $allEmailAddressesByField = $this->getAllEmailAddresses($parts);

        return new ParsedMail(
            $mail,
            $mailPart,
            $parts,
            $loggingEmails,
            $allEmailAddressesByField,
            $envelopedEmail
        );
    }
public function parse ( $ mail ) { // Initial /** @var Part $mailPart */ $ mailPart = $ this -> workAroundMissingBoundary ( $ this -> partFactory -> getPart ( $ mail ) , $ mail ) ; $ partTreeFactory = new PartTreeFactory ( $ this -> partFactory ) ; $ partTree = $ partTreeFactory -> make ( $ mailPart ) ; /** @var Part[] $parts */ $ parts = $ partTree -> flattenParts ( ) ; /** @var Part $envelopedEmail */ $ envelopedEmail = $ partTree -> getEnvelopedEmail ( ) ; // Everything else $ loggingEmails = $ this -> getLoggingEmails ( $ mailPart , $ parts ) ; // All email addresses as a hash in the form $allEmailAddressesByField[field] = []; $ allEmailAddressesByField = $ this -> getAllEmailAddresses ( $ parts ) ; return new ParsedMail ( $ mail , $ mailPart , $ parts , $ loggingEmails , $ allEmailAddressesByField , $ envelopedEmail ) ; }
Accepts the raw email as a string, including headers and body. Has to be called before the other functions
are available.

@param string $mail
@return ParsedMail
Accepts the raw email as a string including headers and body . Has to be called before the other functions are available .