Parse the full MIME document for an email message, returning the content of the message broken into its constituent pieces
Signature
public function parse(string
$raw_message )
Parameters
$raw_message
—
string
the full MIME document of an email message
Returns
struct
the parsed message - subject string the subject of the message
- from_email string the email address of the sender
- from_name string the alias of the sender (if any)
- to array an array of any recipients in the message
- to[] struct the information on a single recipient
- email string the email address of the recipient
- name string the alias of the recipient (if any)
- headers struct the key-value pairs of the MIME headers for the message's main document
- text string the text part of the message, if any
- html string the HTML part of the message, if any
- attachments array an array of any attachments that can be found in the message
- attachments[] struct information about an individual attachment
- name string the file name of the attachment
- type string the MIME type of the attachment
- binary boolean if this is set to true, the attachment is not pure-text, and the content will be base64 encoded
- content string the content of the attachment as a text string or a base64 encoded string based on the attachment type
- images array an array of any embedded images that can be found in the message
- images[] struct information about an individual image
- name string the Content-ID of the embedded image
- type string the MIME type of the image
- content string the content of the image as a base64 encoded string