Copied!

An email message.

The message could represent a simple text email, a multipart message with
children, or a non-mime message containing UUEncoded parts.

CloneableInstantiable
Methods
public __construct(?ZBateson\MailMimeParser\Message\PartStreamContainer $streamContainer = NULL, ?ZBateson\MailMimeParser\Message\PartHeaderContainer $headerContainer = NULL, ?ZBateson\MailMimeParser\Message\PartChildrenContainer $partChildrenContainer = NULL, ?ZBateson\MailMimeParser\Message\Helper\MultipartHelper $multipartHelper = NULL, ?ZBateson\MailMimeParser\Message\Helper\PrivacyHelper $privacyHelper = NULL)
public ZBateson\MailMimeParser\Message\MessagePart::__toString() : string
public addAttachmentPart( $resource, $mimeType, $filename = NULL, $disposition = 'attachment', $encoding = 'base64')
public addAttachmentPartFromFile( $filePath, $mimeType, $filename = NULL, $disposition = 'attachment', $encoding = 'base64')
public ZBateson\MailMimeParser\Message\MultiPart::addChild(ZBateson\MailMimeParser\Message\IMessagePart $part, $position = NULL)
public ZBateson\MailMimeParser\Message\MimePart::addRawHeader( $name, $value)
public ZBateson\MailMimeParser\Message\MessagePart::attach(SplObserver $observer)
 
public ZBateson\MailMimeParser\Message\MessagePart::attachContentStream(Psr\Http\Message\StreamInterface $stream, $streamCharset = 'UTF-8'ZBateson\MailMimeParser\MailMimeParser::DEFAULT_CHARSET)
public ZBateson\MailMimeParser\Message\MessagePart::detach(SplObserver $observer)
 
public ZBateson\MailMimeParser\Message\MessagePart::detachContentStream()
public static from( $resource, $attached)
 

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

If the passed $resource is a resource handle or StreamInterface, the
resource must remain open while the returned IMessage object exists.
Pass true as the second argument to have the resource attached to the
IMessage and closed for you when it's destroyed, or pass false to
manually close it if it should remain open after the IMessage object is
destroyed.

public getAllAttachmentParts()
public ZBateson\MailMimeParser\Message\MimePart::getAllHeaders()
public ZBateson\MailMimeParser\Message\MimePart::getAllHeadersByName( $name)
public ZBateson\MailMimeParser\Message\MultiPart::getAllParts( $fnFilter = NULL)
public ZBateson\MailMimeParser\Message\MultiPart::getAllPartsByMimeType( $mimeType)
public getAttachmentCount()
public getAttachmentPart( $index)
public ZBateson\MailMimeParser\Message\MessagePart::getBinaryContentResourceHandle()
public ZBateson\MailMimeParser\Message\MessagePart::getBinaryContentStream()
public ZBateson\MailMimeParser\Message\MimePart::getCharset()
 

Returns the charset of the content, or null if not applicable/defined.

Looks for a 'charset' parameter under the 'Content-Type' header of this
part and returns it if set, defaulting to 'ISO-8859-1' if the
Content-Type header exists and is of type text/plain or text/html.

Note that the returned value is also converted to upper case.

public ZBateson\MailMimeParser\Message\MultiPart::getChild( $index, $fnFilter = NULL)
public ZBateson\MailMimeParser\Message\MultiPart::getChildCount( $fnFilter = NULL)
public ZBateson\MailMimeParser\Message\MultiPart::getChildIterator()
public ZBateson\MailMimeParser\Message\MultiPart::getChildParts( $fnFilter = NULL)
public ZBateson\MailMimeParser\Message\MessagePart::getContent( $charset = 'UTF-8'ZBateson\MailMimeParser\MailMimeParser::DEFAULT_CHARSET)
public ZBateson\MailMimeParser\Message\MimePart::getContentDisposition( $default = 'inline')
 

Returns the content's disposition, or returns the value of $default if
not defined.

Looks at the 'Content-Disposition' header, which should only contain
either 'inline' or 'attachment'. If the header is not one of those
values, $default is returned, which defaults to 'inline' unless passed
something else.

public ZBateson\MailMimeParser\Message\MimePart::getContentId()
 

Returns the Content ID of the part, or null if not defined.

Looks up and returns the value of the 'Content-ID' header.

public ZBateson\MailMimeParser\Message\MessagePart::getContentStream( $charset = 'UTF-8'ZBateson\MailMimeParser\MailMimeParser::DEFAULT_CHARSET)
public ZBateson\MailMimeParser\Message\MimePart::getContentTransferEncoding( $default = '7bit')
 

Returns the content transfer encoding used to encode the content on this
part, or the value of $default if not defined.

Looks up and returns the value of the 'Content-Transfer-Encoding' header
if set, defaulting to '7bit' if an alternate $default param is not
passed.

The returned value is always lowercase, and header values of 'x-uue',
'uue' and 'uuencode' will return 'x-uuencode' instead.

public ZBateson\MailMimeParser\Message\MimePart::getContentType( $default = 'text/plain')
 

Returns the mime type of the content, or $default if one is not set.

Looks at the part's Content-Type header and returns its value if set, or
defaults to 'text/plain'.

Note that the returned value is converted to lower case, and may not be
identical to calling {@see MimePart::getHeaderValue('Content-Type')} in
some cases.

public ZBateson\MailMimeParser\Message\MultiPart::getCountOfPartsByMimeType( $mimeType)
public ZBateson\MailMimeParser\Message\MimePart::getFilename()
 

Returns a filename for the part if one is defined, or null otherwise.

Uses the 'filename' parameter of the Content-Disposition header if it
exists, or the 'name' parameter of the 'Content-Type' header if it
doesn't.

public ZBateson\MailMimeParser\Message\MimePart::getHeader( $name, $offset = 0)
public ZBateson\MailMimeParser\Message\MimePart::getHeaderParameter( $header, $param, $defaultValue = NULL)
public ZBateson\MailMimeParser\Message\MimePart::getHeaderValue( $name, $defaultValue = NULL)
public getHtmlContent( $index = 0, $charset = 'UTF-8'ZBateson\MailMimeParser\MailMimeParser::DEFAULT_CHARSET)
public getHtmlPart( $index = 0)
public getHtmlPartCount()
public getHtmlStream( $index = 0, $charset = 'UTF-8'ZBateson\MailMimeParser\MailMimeParser::DEFAULT_CHARSET)
public ZBateson\MailMimeParser\Message\MessagePart::getParent()
public ZBateson\MailMimeParser\Message\MultiPart::getPart( $index, $fnFilter = NULL)
public ZBateson\MailMimeParser\Message\MultiPart::getPartByContentId( $contentId)
public ZBateson\MailMimeParser\Message\MultiPart::getPartByMimeType( $mimeType, $index = 0)
public ZBateson\MailMimeParser\Message\MultiPart::getPartCount( $fnFilter = NULL)
public ZBateson\MailMimeParser\Message\MimePart::getRawHeaderIterator()
public ZBateson\MailMimeParser\Message\MimePart::getRawHeaders()
public ZBateson\MailMimeParser\Message\MessagePart::getResourceHandle()
public getSignaturePart()
public getSignedMessageAsString()
public getSignedMessageStream()
public ZBateson\MailMimeParser\Message\MessagePart::getStream()
public getTextContent( $index = 0, $charset = 'UTF-8'ZBateson\MailMimeParser\MailMimeParser::DEFAULT_CHARSET)
public getTextPart( $index = 0)
public getTextPartCount()
public getTextStream( $index = 0, $charset = 'UTF-8'ZBateson\MailMimeParser\MailMimeParser::DEFAULT_CHARSET)
public ZBateson\MailMimeParser\Message\MessagePart::hasContent()
public isMime()
 

Returns true if the current part is a mime part.

The message is considered 'mime' if it has either a Content-Type or
MIME-Version header defined.

public ZBateson\MailMimeParser\Message\MimePart::isMultiPart()
public ZBateson\MailMimeParser\Message\MimePart::isSignaturePart()
 

Returns true if this part's parent is an IMessage, and is the same part
returned by {@see IMessage::getSignaturePart()}.

public ZBateson\MailMimeParser\Message\MimePart::isTextPart()
 

Returns true if this part has a defined 'charset' on its Content-Type
header.

This may result in some false positives if charset is set on a part that
is not plain text which has been seen. If a part is known to be binary,
it's better to use {@see \IMessagePart::getBinaryContentStream()} to
avoid issues, or to call {@see \IMessagePart::saveContent()} directly if
saving a part's content.

public ZBateson\MailMimeParser\Message\MessagePart::notify()
 
public removeAllHtmlParts( $moveRelatedPartsBelowMessage = true)
public ZBateson\MailMimeParser\Message\MultiPart::removeAllParts( $fnFilter = NULL)
public removeAllTextParts( $moveRelatedPartsBelowMessage = true)
public removeAttachmentPart( $index)
public ZBateson\MailMimeParser\Message\MimePart::removeHeader( $name)
public removeHtmlPart( $index = 0)
public ZBateson\MailMimeParser\Message\MultiPart::removePart(ZBateson\MailMimeParser\Message\IMessagePart $part)
public ZBateson\MailMimeParser\Message\MimePart::removeSingleHeader( $name, $offset = 0)
public removeTextPart( $index = 0)
public ZBateson\MailMimeParser\Message\MessagePart::save( $filenameResourceOrStream, $filemode = 'w+')
public ZBateson\MailMimeParser\Message\MessagePart::saveContent( $filenameResourceOrStream)
public setAsMultipartSigned( $micalg, $protocol)
public ZBateson\MailMimeParser\Message\MessagePart::setCharsetOverride( $charsetOverride, $onlyIfNoCharset = false)
public ZBateson\MailMimeParser\Message\MessagePart::setContent( $resource, $charset = 'UTF-8'ZBateson\MailMimeParser\MailMimeParser::DEFAULT_CHARSET)
public setHtmlPart( $resource, $charset = 'UTF-8')
public ZBateson\MailMimeParser\Message\MimePart::setRawHeader( $name, $value, $offset = 0)
public setSignature( $body)
public setTextPart( $resource, $charset = 'UTF-8')
Properties
protected ZBateson\MailMimeParser\Message\MessagePart::$charsetOverride
 
protected ZBateson\MailMimeParser\Message\MimePart::$headerContainer
 
protected ZBateson\MailMimeParser\Message\MessagePart::$ignoreTransferEncoding
 
  • var phpDocumentor\Reflection\Types\Boolean set to true when a user attaches a stream manually, it's
    assumed to already be decoded or to have relevant transfer encoding
    decorators attached already.
protected ZBateson\MailMimeParser\Message\MessagePart::$observers
 
protected ZBateson\MailMimeParser\Message\MessagePart::$parent
protected ZBateson\MailMimeParser\Message\MultiPart::$partChildrenContainer
 
protected ZBateson\MailMimeParser\Message\MessagePart::$partStreamContainer
 
Properties
private $multipartHelper
 
private $privacyHelper
 
Methods
public static from( $resource, $attached)
 

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

If the passed $resource is a resource handle or StreamInterface, the
resource must remain open while the returned IMessage object exists.
Pass true as the second argument to have the resource attached to the
IMessage and closed for you when it's destroyed, or pass false to
manually close it if it should remain open after the IMessage object is
destroyed.

© 2023 Bruce Wells
Search Namespaces \ Classes
Configuration