createEmailFromRelatedPart example

// try to convert to a "simple" Email instance         $body = $message->getBody();
        if ($body instanceof TextPart) {
            return self::createEmailFromTextPart($message$body);
        }

        if ($body instanceof AlternativePart) {
            return self::createEmailFromAlternativePart($message$body);
        }

        if ($body instanceof RelatedPart) {
            return self::createEmailFromRelatedPart($message$body);
        }

        if ($body instanceof MixedPart) {
            $parts = $body->getParts();
            if ($parts[0] instanceof RelatedPart) {
                $email = self::createEmailFromRelatedPart($message$parts[0]);
            } elseif ($parts[0] instanceof AlternativePart) {
                $email = self::createEmailFromAlternativePart($message$parts[0]);
            } elseif ($parts[0] instanceof TextPart) {
                $email = self::createEmailFromTextPart($message$parts[0]);
            } else {
                
// try to convert to a "simple" Email instance         $body = $message->getBody();
        if ($body instanceof TextPart) {
            return self::createEmailFromTextPart($message$body);
        }

        if ($body instanceof AlternativePart) {
            return self::createEmailFromAlternativePart($message$body);
        }

        if ($body instanceof RelatedPart) {
            return self::createEmailFromRelatedPart($message$body);
        }

        if ($body instanceof MixedPart) {
            $parts = $body->getParts();
            if ($parts[0] instanceof RelatedPart) {
                $email = self::createEmailFromRelatedPart($message$parts[0]);
            } elseif ($parts[0] instanceof AlternativePart) {
                $email = self::createEmailFromAlternativePart($message$parts[0]);
            } elseif ($parts[0] instanceof TextPart) {
                $email = self::createEmailFromTextPart($message$parts[0]);
            } else {
                
Home | Imprint | This part of the site doesn't use cookies.