Provides various routines to manipulate and create multipart messages from an
existing message (e.g. to make space for attachments in a message, or to
change a simple message to a multipart/alternative one, etc...)

public __construct(ZBateson\MailMimeParser\Message\Factory\IMimePartFactory $mimePartFactory, ZBateson\MailMimeParser\Message\Factory\IUUEncodedPartFactory $uuEncodedPartFactory, ZBateson\MailMimeParser\Message\Helper\GenericHelper $genericHelper)
public createAlternativeContentPart(ZBateson\MailMimeParser\IMessage $message, ZBateson\MailMimeParser\Message\IMessagePart $contentPart)

Creates a new mime part as a multipart/alternative and assigns the passed
$contentPart as a part below it before returning it.

public createAndAddPartForAttachment(ZBateson\MailMimeParser\IMessage $message, $resource, $mimeType, $disposition, $filename = NULL, $encoding = 'base64')

Creates and adds a IMimePart for the passed content and options as an

public createContentPartForMimeType(ZBateson\MailMimeParser\IMessage $message, $mimeType, $charset)

Creates a new content part for the passed mimeType and charset, making
space by creating a multipart/alternative if needed

public createMultipartRelatedPartForInlineChildrenOf(ZBateson\MailMimeParser\Message\IMimePart $parent)

Creates a multipart/related part out of 'inline' children of $parent and
returns it.

public enforceMime(ZBateson\MailMimeParser\IMessage $message)

Enforces the message to be a mime message for a non-mime (e.g. uuencoded
or unspecified) message. If the message has uuencoded attachments, sets
up the message as a multipart/mixed message and creates a separate
content part.

public findOtherContentPartFor(ZBateson\MailMimeParser\IMessage $message, $mimeType)

Finds an alternative inline part in the message and returns it if one

If the passed $mimeType is text/plain, searches for a text/html part.
Otherwise searches for a text/plain part to return.

public getContentPartContainerFromAlternative( $mimeType, ZBateson\MailMimeParser\Message\IMimePart $alternativePart)

Searches the passed $alternativePart for a part with the passed mime type
and returns its parent.

Used for alternative mime types that have a multipart/mixed or
multipart/related child containing a content part of $mimeType, where
the whole mixed/related part should be removed.

public getUniqueBoundary( $mimeType)

Creates and returns a unique boundary.

public moveAllNonMultiPartsToMessageExcept(ZBateson\MailMimeParser\IMessage $message, ZBateson\MailMimeParser\Message\IMimePart $from, $exceptMimeType)

Moves all parts under $from into this message except those with a
content-type equal to $exceptMimeType. If the message is not a
multipart/mixed message, it is set to multipart/mixed first.

public removeAllContentPartsByMimeType(ZBateson\MailMimeParser\IMessage $message, $mimeType, $keepOtherContent = false)

Removes the content part of the message with the passed mime type. If
there is a remaining content part and it is an alternative part of the
main message, the content part is moved to the message part.

If the content part is part of an alternative part beneath the message,
the alternative part is replaced by the remaining content part,
optionally keeping other parts if $keepOtherContent is set to true.

public removeAllContentPartsFromAlternative(ZBateson\MailMimeParser\IMessage $message, $mimeType, ZBateson\MailMimeParser\Message\IMimePart $alternativePart, $keepOtherContent)

Removes all parts of $mimeType from $alternativePart.

If $alternativePart contains a multipart/mixed or multipart/relative part
with other parts of different content-types, the multipart part is
removed, and parts of different content-types can optionally be moved to
the main message part.

public removePartByMimeType(ZBateson\MailMimeParser\IMessage $message, $mimeType, $index = 0)

Removes the 'inline' part with the passed contentType, at the given index
defaulting to the first

public setContentPartForMimeType(ZBateson\MailMimeParser\IMessage $message, $mimeType, $stringOrHandle, $charset)

Either creates a mime part or sets the existing mime part with the passed
mimeType to $strongOrHandle.

public setMessageAsAlternative(ZBateson\MailMimeParser\IMessage $message)

Sets the passed message as multipart/alternative.

If the message has content, a new part is created and added as a child of
the message. The message's content and content headers are moved to the
new part.

public setMessageAsMixed(ZBateson\MailMimeParser\IMessage $message)

Sets the passed message as multipart/mixed.

If the message has content, a new part is created and added as a child of
the message. The message's content and content headers are moved to the
new part.

public setMimeHeaderBoundaryOnPart(ZBateson\MailMimeParser\Message\IMimePart $part, $mimeType)

Creates a unique mime boundary and assigns it to the passed part's
Content-Type header with the passed mime type.

protected ZBateson\MailMimeParser\Message\Helper\AbstractHelper::$mimePartFactory
protected ZBateson\MailMimeParser\Message\Helper\AbstractHelper::$uuEncodedPartFactory
private $genericHelper
© 2023 Bruce Wells
Search Namespaces \ Classes