Provides common Message helper routines for Message manipulation.
- author Zaahid Bateson
Methods |
public copyContentHeadersAndContent(ZBateson Copies Content-* headers from the $from header into the $to header. If the Content-Type header isn't defined in $from, defaults to text/plain with utf-8 and quoted-printable as its Content-Transfer-Encoding. An exception is made for the obsolete Content-Return header, which isn't isn't a MIME content field and so isn't copied.
|
public copyHeader(ZBateson Copies the passed $header from $from, to $to or sets the header to $default if it doesn't exist in $from.
|
public createNewContentPartFrom(ZBateson 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).
|
public movePartContentAndChildren(ZBateson 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. |
public removeContentHeadersAndContent(ZBateson Removes Content-* headers from the passed part, then detaches its content stream. An exception is made for the obsolete Content-Return header, which isn't isn't a MIME content field and so isn't removed. |
public replacePart(ZBateson Replaces the $part IMimePart with $replacement. Essentially removes $part from its parent, and adds $replacement in its same position. If $part is the IMessage, then $part can't be removed and replaced, and instead $replacement's type headers are copied to $message, and any children below $replacement are added directly below $message. |
Properties |
Properties |
private static array $nonMimeContentFields = ['contentreturn', 'contentidentifier']
|
Methods |
private isMimeContentField(ZBateson Returns true if the passed header's name is a Content-* header other than one defined in the static $nonMimeContentFields |
Properties |
private static array $nonMimeContentFields = ['contentreturn', 'contentidentifier']
|