A parsed mime message with optional mime parts depending on its type.

A mime message may have any number of mime parts, and each part may have any number of sub-parts, etc...

author Zaahid Bateson
package MailMimeParser
inherited_from \ZBateson\MailMimeParser\Message\MimePart

 Methods

Constructs a Message.

__construct(\ZBateson\MailMimeParser\Header\HeaderFactory $headerFactory, \ZBateson\MailMimeParser\Message\Writer\MessageWriter $messageWriter, \ZBateson\MailMimeParser\Message\MimePartFactory $mimePartFactory) 
inherited_from \ZBateson\MailMimeParser\Message\MimePart::__construct()

Parameters

$headerFactory

\ZBateson\MailMimeParser\Header\HeaderFactory

$messageWriter

\ZBateson\MailMimeParser\Message\Writer\MessageWriter

$mimePartFactory

\ZBateson\MailMimeParser\Message\MimePartFactory

Sets up class dependencies.

__construct(\ZBateson\MailMimeParser\Header\HeaderFactory $headerFactory, \ZBateson\MailMimeParser\Message\Writer\MimePartWriter $partWriter) 
Inherited

Parameters

$headerFactory

\ZBateson\MailMimeParser\Header\HeaderFactory

$partWriter

\ZBateson\MailMimeParser\Message\Writer\MimePartWriter

Closes the attached resource handle.

__destruct() 
Inherited

Shortcut to call Message::save with a php://temp stream and return the written email message as a string.

__toString() : string

Returns

string

Adds an attachment part for the passed raw data string or handle and given parameters.

addAttachmentPart(string|\ZBateson\MailMimeParser\handle $stringOrHandle, \ZBateson\MailMimeParser\strubg $mimeType, string $filename = null, string $disposition = 'attachment') : \ZBateson\MailMimeParser\Message\MimePart

Parameters

$stringOrHandle

string\ZBateson\MailMimeParser\handle

$mimeType

\ZBateson\MailMimeParser\strubg

$filename

string

$disposition

string

Returns

\ZBateson\MailMimeParser\Message\MimePart

Adds an attachment part using the passed file.

addAttachmentPartFromFile(string $file, string $mimeType, string $filename = null, string $disposition = 'attachment') : \ZBateson\MailMimeParser\Message\MimePart

Essentially creates a file stream and uses it.

Parameters

$file

string

$mimeType

string

$filename

string

$disposition

string

Returns

\ZBateson\MailMimeParser\Message\MimePart

Registers the passed part as a child of the current part.

addPart(\ZBateson\MailMimeParser\Message\MimePart $part, integer $position = null
Inherited

If the $position parameter is non-null, adds the part at the passed position index.

Parameters

$part

\ZBateson\MailMimeParser\Message\MimePart

$position

integer

Attaches the resource handle for the part's content. The attached handle is closed when the MimePart object is destroyed.

attachContentResourceHandle(resource $contentHandle) 
Inherited

Parameters

$contentHandle

resource

Attaches the resource handle representing the original stream that created this part (including any sub-parts). The attached handle is closed when the MimePart object is destroyed.

attachOriginalStreamHandle(resource $handle) 
Inherited

This stream is not modified or changed as the part is changed and is only set during parsing in MessageParser.

Parameters

$handle

resource

Creates and returns a new MimePart for the signature part of a multipart/signed message

createSignaturePart(string $body) 

Parameters

$body

string

Convenience method to parse a handle or string into a Message without requiring including MailMimeParser, instantiating it, and calling parse.

from(resource|string $handleOrString) 
Static

Parameters

$handleOrString

resourcestring

the resource handle to the input stream of the mime message, or a string containing a mime message

Returns all attachment parts.

getAllAttachmentParts() : array<mixed,\ZBateson\MailMimeParser\Message\MimePart>

Attachments are any non-multipart, non-signature and non inline text or html part (a text or html part with a Content-Disposition set to 'attachment' is considered an attachment).

Returns

array<mixed,\ZBateson\MailMimeParser\Message\MimePart>

Returns the current part, all child parts, and child parts of all children optionally filtering them with the provided PartFilter.

getAllParts(\ZBateson\MailMimeParser\Message\PartFilter $filter = null) : array<mixed,\ZBateson\MailMimeParser\Message\MimePart>
Inherited

The first part returned is always the current MimePart. This is often desirable as it may be a valid MimePart for the provided PartFilter.

Parameters

$filter

\ZBateson\MailMimeParser\Message\PartFilter

an optional filter

Returns

array<mixed,\ZBateson\MailMimeParser\Message\MimePart>

Returns an array of all parts associated with the passed mime type if any exist or null otherwise.

getAllPartsByMimeType(string $mimeType) : array<mixed,\ZBateson\MailMimeParser\Message\MimePart>
Inherited

Parameters

$mimeType

string

Returns

array<mixed,\ZBateson\MailMimeParser\Message\MimePart>or null

Returns the number of attachments available.

getAttachmentCount() : integer

Returns

integer

Returns the attachment part at the given 0-based index, or null if none is set.

getAttachmentPart(integer $index) : \ZBateson\MailMimeParser\Message\MimePart

Parameters

$index

integer

Returns

\ZBateson\MailMimeParser\Message\MimePart

Returns the direct child at the given 0-based index, or null if none is set.

getChild(integer $index, \ZBateson\MailMimeParser\Message\PartFilter $filter = null) : \ZBateson\MailMimeParser\Message\MimePart
Inherited

Parameters

$index

integer

$filter

\ZBateson\MailMimeParser\Message\PartFilter

Returns

\ZBateson\MailMimeParser\Message\MimePart

Returns the number of direct children under this part.

getChildCount(\ZBateson\MailMimeParser\Message\PartFilter $filter = null) : integer
Inherited

Parameters

$filter

\ZBateson\MailMimeParser\Message\PartFilter

Returns

integer

Returns all direct child parts.

getChildParts(\ZBateson\MailMimeParser\Message\PartFilter $filter = null) : array<mixed,\ZBateson\MailMimeParser\Message\MimePart>
Inherited

If a PartFilter is provided, the PartFilter is applied before returning.

Parameters

$filter

\ZBateson\MailMimeParser\Message\PartFilter

Returns

array<mixed,\ZBateson\MailMimeParser\Message\MimePart>

Shortcut to reading stream content and assigning it to a string. Returns null if the part doesn't have a content stream.

getContent() : string
Inherited

Returns

string

Returns the content MimePart, which could be a text/plain part, text/html part, multipart/alternative part, or null if none is set.

getContentPart() : \ZBateson\MailMimeParser\Message\MimePart

This function is deprecated in favour of getTextPart/getHtmlPart and getPartByMimeType.

deprecated since version 0.4.2

Returns

\ZBateson\MailMimeParser\Message\MimePart

Returns the resource stream handle for the part's content or null if not set. rewind() is called on the stream before returning it.

getContentResourceHandle() : resource
Inherited

The resource is automatically closed by MimePart's destructor and should not be closed otherwise.

The returned resource handle is a stream with decoding filters appended to it. The attached filters are determined by looking at the part's Content-Encoding header. The following encodings are currently supported:

  • Quoted-Printable
  • Base64
  • X-UUEncode

UUEncode may be automatically attached for a message without a defined Content-Encoding and Content-Type if it has a UUEncoded part to support older non-mime message attachments.

In addition, character encoding for text streams is converted to UTF-8 if \ZBateson\MailMimeParser\Message\MimePart::isTextPart returns true.

Returns

resource

Returns the number of parts matching the passed $mimeType

getCountOfPartsByMimeType(string $mimeType) : integer
Inherited

Parameters

$mimeType

string

Returns

integer

Returns the AbstractHeader object for the header with the given $name

getHeader(string $name) : \ZBateson\MailMimeParser\Header\AbstractHeader
Inherited

Note that mime headers aren't case sensitive.

Parameters

$name

string

Returns

\ZBateson\MailMimeParser\Header\AbstractHeader

Returns a parameter of the header $header, given the parameter named $param.

getHeaderParameter(string $header, string $param, string $defaultValue = null) : string
Inherited

Only headers of type \ZBateson\MailMimeParser\Header\ParameterHeader have parameters. Content-Type and Content-Disposition are examples of headers with parameters. "Charset" is a common parameter of Content-Type.

Parameters

$header

string

$param

string

$defaultValue

string

Returns

string

Returns the string value for the header with the given $name.

getHeaderValue(string $name, string $defaultValue = null) : string
Inherited

Note that mime headers aren't case sensitive.

Parameters

$name

string

$defaultValue

string

Returns

string

Returns the full array of headers for this part.

getHeaders() : array<mixed,\ZBateson\MailMimeParser\Header\AbstractHeader>
Inherited

Returns

array<mixed,\ZBateson\MailMimeParser\Header\AbstractHeader>

Returns the content of the inline text/html part at the given index.

getHtmlContent(integer $index = 0) : string

Reads the entire stream content into a string and returns it. Returns null if the message doesn't have an inline html part.

Parameters

$index

integer

Returns

string

Returns the text/html part at the given index (or null if not found.)

getHtmlPart($index = 0) : \ZBateson\MailMimeParser\Message\MimePart

Parameters

$index

Returns

\ZBateson\MailMimeParser\Message\MimePart

Returns the number of text/html parts in this message.

getHtmlPartCount() : integer

Returns

integer

Returns a resource handle where the 'inline' text/html content at the passed $index can be read or null if unavailable.

getHtmlStream($index = 0) : resource

Parameters

$index

Returns

resource

Returns the unique object ID registered with the PartStreamRegistry service object.

getObjectId() : string

Returns

string

Returns a string containing the original message's signed part, useful for verifying the email.

getOriginalMessageStringForSignatureVerification() : string

If the signed part of the message ends in a final empty line, the line is removed as it's considered part of the signature's mime boundary. From RFC-3156:

Note: The accepted OpenPGP convention is for signed data to end with a sequence. Note that the sequence immediately preceding a MIME boundary delimiter line is considered to be part of the delimiter in [3], 5.1. Thus, it is not part of the signed data preceding the delimiter line. An implementation which elects to adhere to the OpenPGP convention has to make sure it inserts a pair on the last line of the data to be signed and transmitted (signed message and transmitted message MUST be identical).

The additional line should be inserted by the signer -- for verification purposes if it's missing, it would seem the content part would've been signed without a last .

Returns

stringor null if the message doesn't have any children, or the child returns null for getOriginalStreamHandle

Returns a resource stream handle allowing a user to read the original stream (including headers and child parts) that was used to create the current part.

getOriginalStreamHandle() : resource
Inherited

The part contains an original stream handle only if it was explicitly set by a call to MimePart::attachOriginalStreamHandle. MailMimeParser only sets this during the parsing phase in MessageParser, and is not otherwise changed or updated. New parts added below this part, changed headers, etc... would not be reflected in the returned stream handle.

Returns

resourcethe resource handle or null if not set

Returns this part's parent.

getParent() : \ZBateson\MailMimeParser\Message\MimePart
Inherited

Returns

\ZBateson\MailMimeParser\Message\MimePart

Returns the part at the given 0-based index, or null if none is set.

getPart(integer $index, \ZBateson\MailMimeParser\Message\PartFilter $filter = null) : \ZBateson\MailMimeParser\Message\MimePart
Inherited

Note that the first part returned is the current part itself. This is often desirable for queries with a PartFilter, e.g. looking for a MimePart with a specific Content-Type that may be satisfied by the current part.

Parameters

$index

integer

$filter

\ZBateson\MailMimeParser\Message\PartFilter

Returns

\ZBateson\MailMimeParser\Message\MimePart

Returns the part associated with the passed mime type if it exists.

getPartByMimeType(string $mimeType, $index = 0) : \ZBateson\MailMimeParser\Message\MimePart
Inherited

Parameters

$mimeType

string

$index

Returns

\ZBateson\MailMimeParser\Message\MimePartor null

Returns the total number of parts in this and all children.

getPartCount(\ZBateson\MailMimeParser\Message\PartFilter $filter = null) : integer
Inherited

Note that the current part is considered, so the minimum getPartCount is 1 without a filter.

Parameters

$filter

\ZBateson\MailMimeParser\Message\PartFilter

Returns

integer

Returns the content part of a signed message for a signature to be calculated on the message.

getSignableBody() : string

Returns

string

Returns the signed part or null if not set.

getSignaturePart() : \ZBateson\MailMimeParser\Message\MimePart

Returns

\ZBateson\MailMimeParser\Message\MimePart

Returns the content of the inline text/plain part at the given index.

getTextContent(integer $index = 0) : string

Reads the entire stream content into a string and returns it. Returns null if the message doesn't have an inline text part.

Parameters

$index

integer

Returns

string

Returns the text/plain part at the given index (or null if not found.)

getTextPart(integer $index = 0) : \ZBateson\MailMimeParser\Message\MimePart

Parameters

$index

integer

Returns

\ZBateson\MailMimeParser\Message\MimePart

Returns the number of text/plain parts in this message.

getTextPartCount() : integer

Returns

integer

Returns a resource handle where the 'inline' text/plain content at the passed $index can be read or null if unavailable.

getTextStream(integer $index = 0) : resource

Parameters

$index

integer

Returns

resource

Returns true if there's a content stream associated with the part.

hasContent() : boolean
Inherited

Returns

boolean

Returns true if either a Content-Type or Mime-Version header are defined in this Message.

isMime() : boolean

Returns

boolean

Returns true if this part's mime type is multipart/*

isMultiPart() : boolean
Inherited

Returns

boolean

Returns true if this part's mime type is text/plain, text/html or has a text/* and has a defined 'charset' attribute.

isTextPart() : boolean
Inherited

Returns

boolean

Removes all text/html inline parts in this message, optionally keeping other inline parts as attachments on the main message (defaults to keeping them).

removeAllHtmlParts(boolean $keepOtherPartsAsAttachments = true) : boolean

Parameters

$keepOtherPartsAsAttachments

boolean

Returns

booleantrue on success

Removes all parts that are matched by the passed PartFilter.

removeAllParts(\ZBateson\MailMimeParser\Message\PartFilter $filter = null
Inherited

Parameters

$filter

\ZBateson\MailMimeParser\Message\PartFilter

Removes all text/plain inline parts in this message, optionally keeping other inline parts as attachments on the main message (defaults to keeping them).

removeAllTextParts(boolean $keepOtherPartsAsAttachments = true) : boolean

Parameters

$keepOtherPartsAsAttachments

boolean

Returns

booleantrue on success

Removes the attachment with the given index

removeAttachmentPart(integer $index) 

Parameters

$index

integer

Removes the header with the given name

removeHeader(string $name) 
Inherited

Parameters

$name

string

Removes the html part of the message if one exists. Returns true on success.

removeHtmlPart($index = 0) : boolean

Parameters

$index

Returns

booleantrue on success

Removes the child part from this part and returns its position or null if it wasn't found.

removePart(\ZBateson\MailMimeParser\Message\MimePart $part) : integer
Inherited

Note that if the part is not a direct child of this part, the returned position is its index within its parent (calls removePart on its direct parent).

Parameters

$part

\ZBateson\MailMimeParser\Message\MimePart

Returns

integeror null if not found

Removes the text/plain part of the message at the passed index if one exists. Returns true on success.

removeTextPart($index = 0) : boolean

Parameters

$index

Returns

booleantrue on success

Saves the message as a MIME message to the passed resource handle.

save(resource $handle) 

Parameters

$handle

resource

Turns the message into a multipart/signed message, moving the actual message into a child part, sets the content-type of the main message to multipart/signed and adds a signature part as well.

setAsMultipartSigned(string $micalg, string $protocol) 

Parameters

$micalg

string

The Message Integrity Check algorithm being used

$protocol

string

The mime-type of the signature body

Sets the content of the part to the passed string (effectively creates a php://temp stream with the passed content and calls attachContentResourceHandle with the opened stream).

setContent(string $string) 
Inherited

Parameters

$string

string

Sets the text/html part of the message to the passed $stringOrHandle, either creating a new part if one doesn't exist for text/html, or assigning the value of $stringOrHandle to an existing text/html part.

setHtmlPart(string|resource $stringOrHandle, string $charset = 'UTF-8'

The optional $charset parameter is the charset for saving to. $stringOrHandle is expected to be in UTF-8 regardless of the target charset.

Parameters

$stringOrHandle

stringresource

$charset

string

Sets the parent part.

setParent(\ZBateson\MailMimeParser\Message\MimePart $part) 
Inherited

Parameters

$part

\ZBateson\MailMimeParser\Message\MimePart

Adds a header with the given $name and $value.

setRawHeader(string $name, string $value) 
Inherited

Creates a new \ZBateson\MailMimeParser\Header\AbstractHeader object and registers it as a header.

Parameters

$name

string

$value

string

Sets the text/plain part of the message to the passed $stringOrHandle, either creating a new part if one doesn't exist for text/plain, or assigning the value of $stringOrHandle to an existing text/plain part.

setTextPart(string|resource $stringOrHandle, string $charset = 'UTF-8'

The optional $charset parameter is the charset for saving to. $stringOrHandle is expected to be in UTF-8 regardless of the target charset.

Parameters

$stringOrHandle

stringresource

$charset

string

Creates and returns a MimePart for use with a new attachment part being created.

createPartForAttachment() : \ZBateson\MailMimeParser\Message\MimePart

Returns

\ZBateson\MailMimeParser\Message\MimePart

Detaches the content resource handle from this part but does not close it.

detachContentResourceHandle() 
Inherited

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.

removeAllContentPartsByMimeType(string $mimeType, boolean $keepOtherContent = false) : boolean

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.

Parameters

$mimeType

string

$keepOtherContent

boolean

Returns

booleantrue on success

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

removePartByMimeType($mimeType, integer $index = 0) : boolean

Parameters

$mimeType

$index

integer

Returns

booleantrue on success

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

setContentPartForMimeType(string $mimeType, string|resource $stringOrHandle, string $charset) 

Parameters

$mimeType

string

$stringOrHandle

stringresource

$charset

string

Copies Content-Type, Content-Disposition and Content-Transfer-Encoding headers from the $from header into the $to header. If the Content-Type header isn't defined in $from, defaults to text/plain and quoted-printable.

copyTypeHeadersFromPartToPart(\ZBateson\MailMimeParser\Message\MimePart $from, \ZBateson\MailMimeParser\Message\MimePart $to) 

Parameters

$from

\ZBateson\MailMimeParser\Message\MimePart

$to

\ZBateson\MailMimeParser\Message\MimePart

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

createAlternativeContentPart(\ZBateson\MailMimeParser\Message\MimePart $contentPart) : \ZBateson\MailMimeParser\Message\MimePart

Parameters

$contentPart

\ZBateson\MailMimeParser\Message\MimePart

Returns

\ZBateson\MailMimeParser\Message\MimePartthe alternative part

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

createContentPartForMimeType(string $mimeType, string $charset) : \ZBateson\MailMimeParser\Message\MimePart

Parameters

$mimeType

string

$charset

string

Returns

\ZBateson\MailMimeParser\Message\MimePart

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

createMultipartRelatedPartForInlineChildrenOf(\ZBateson\MailMimeParser\Message\MimePart $parent) : \ZBateson\MailMimeParser\Message\MimePart

Parameters

$parent

\ZBateson\MailMimeParser\Message\MimePart

Returns

\ZBateson\MailMimeParser\Message\MimePart

Creates a new content part from the passed part, allowing the part to be used for something else (e.g. changing a non-mime message to a multipart mime message).

createNewContentPartFromPart(\ZBateson\MailMimeParser\Message\MimePart $part) : \ZBateson\MailMimeParser\Message\MimePart

Parameters

$part

\ZBateson\MailMimeParser\Message\MimePart

Returns

\ZBateson\MailMimeParser\Message\MimePartthe newly-created MimePart

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 content part.

enforceMime() 

Ensures a non-text part comes first in a signed multipart/alternative message as some clients seem to prefer the first content part if the client doesn't understand multipart/signed.

ensureHtmlPartFirstForSignedMessage() 

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

findOtherContentPartFor(string $mimeType) : \ZBateson\MailMimeParser\MimeType

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

Parameters

$mimeType

string

Returns

\ZBateson\MailMimeParser\MimeTypeor null if not found

Returns the direct child of $alternativePart containing a part of $mimeType.

getContentPartContainerFromAlternative(string $mimeType, \ZBateson\MailMimeParser\Message\MimePart $alternativePart) : boolean | \ZBateson\MailMimeParser\Message\MimePart

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.

Parameters

$mimeType

string

the content-type to find below $alternativePart

$alternativePart

\ZBateson\MailMimeParser\Message\MimePart

The multipart/alternative part to look under

Returns

boolean\ZBateson\MailMimeParser\Message\MimePartfalse if a part is not found

Returns an open resource handle for the passed string or resource handle.

getHandleForStringOrHandle(resource|string $stringOrHandle) : resource

For a string, creates a php://temp stream and returns it.

Parameters

$stringOrHandle

resourcestring

Returns

resource

Creates and returns a unique boundary.

getUniqueBoundary(string $mimeType) : string

Parameters

$mimeType

string

first 3 characters of a multipart type are used, e.g. REL for relative or ALT for alternative

Returns

string

This function makes space by moving the main message part down one level.

makeSpaceForMultipartSignedMessage() 

The content-type, content-disposition and content-transfer-encoding headers are copied from this message to the newly created part, the resource handle is moved and detached, any attachments and content parts with parents set to this message get their parents set to the newly created part.

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.

moveAllPartsAsAttachmentsExcept(\ZBateson\MailMimeParser\Message\MimePart $from, string $exceptMimeType) 

Parameters

$from

\ZBateson\MailMimeParser\Message\MimePart

$exceptMimeType

string

Copies type headers (Content-Type, Content-Disposition, Content-Transfer-Encoding) from the $from MimePart to $to. Attaches the content resource handle of $from to $to, and loops over child parts, removing them from $from and adding them to $to.

movePartContentAndChildrenToPart(\ZBateson\MailMimeParser\Message\MimePart $from, \ZBateson\MailMimeParser\Message\MimePart $to) 

Parameters

$from

\ZBateson\MailMimeParser\Message\MimePart

$to

\ZBateson\MailMimeParser\Message\MimePart

Loops over parts of this message and sets the content-transfer-encoding header to quoted-printable for text/* mime parts, and to base64 otherwise for parts that are '8bit' encoded.

overwrite8bitContentEncoding() 

Used for multipart/signed messages which doesn't support 8bit transfer encodings.

Removes all parts of $mimeType from $alternativePart.

removeAllContentPartsFromAlternative(string $mimeType, \ZBateson\MailMimeParser\Message\MimePart $alternativePart, boolean $keepOtherContent) : boolean

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.

Parameters

$mimeType

string

$alternativePart

\ZBateson\MailMimeParser\Message\MimePart

$keepOtherContent

boolean

Returns

boolean

Replaces the $part MimePart with $replacement.

replacePart(\ZBateson\MailMimeParser\Message\MimePart $part, \ZBateson\MailMimeParser\Message\MimePart $replacement) 

Essentially removes $part from its parent, and adds $replacement in its same position. If $part is this Message, its type headers are moved from this message to $replacement, the content resource is moved, and children are assigned to $replacement.

Parameters

$part

\ZBateson\MailMimeParser\Message\MimePart

$replacement

\ZBateson\MailMimeParser\Message\MimePart

Sets this message to be a multipart/alternative message, making space for a second content part.

setMessageAsAlternative() 

Creates a content part and assigns the content stream from the message to that newly created part.

Creates a new part out of the current contentPart and sets the message's type to be multipart/mixed.

setMessageAsMixed() 

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

setMimeHeaderBoundaryOnPart(\ZBateson\MailMimeParser\Message\MimePart $part, string $mimeType) 

Parameters

$part

\ZBateson\MailMimeParser\Message\MimePart

$mimeType

string

 Properties

 

the content's resource handle

$handle : resource

Default

 

the HeaderFactory object used for created headers

$headerFactory : \ZBateson\MailMimeParser\Header\HeaderFactory

Default

 

array of header objects

$headers : array<mixed,\ZBateson\MailMimeParser\Header\AbstractHeader>

Default

 

the part writer for this Message. The same object is assigned to $partWriter but as an AbstractWriter -- not really needed in PHP but helps with auto-complete and code analyzers.

$messageWriter : \ZBateson\MailMimeParser\Message\Writer\MessageWriter

Default

null
 

a MimePartFactory to create parts for attachments/content

$mimePartFactory : \ZBateson\MailMimeParser\Message\MimePartFactory

Default

 

unique ID used to identify the object to $this->partStreamRegistry when registering the stream. The ID is used for opening stream parts with the mmp-mime-message "protocol".

$objectId : string

Default

see
see
 

$originalStreamHandle

$originalStreamHandle 

Default

 

parent part

$parent : \ZBateson\MailMimeParser\Message\MimePart

Default

 

the part writer for this MimePart

$partWriter : \ZBateson\MailMimeParser\Message\Writer\MimePartWriter

Default

null
 

array of parts in this message

$parts : array<mixed,\ZBateson\MailMimeParser\Message\MimePart>

Default

array()