Peeker Body


Body Class

This class handles the email Body data.

Important:  All of these functions are available through the message object returned by the Peeker class. Notated here as: $e

Function Reference

get_body()

Pull in the email message body data. Returns true. The message properties are populated. This generally includes the PLAIN and HTML version of an email. If there is a parts class set this function also gets the email parts.

$e->get_body();

get_body_string()

Get the raw, undecoded body string.

$e->get_body_string();

get_plain()

Get the PLAIN part of a multipart/alternative email.

$e->get_plain();

get_html()

Get the HTML part of a multipart/alternative email.

$e->get_html()

get_html_filtered()

Specialized. If you have set up a function to manipulate the HTML, you can put the changed HTML into the html_filtered property and get it with this function. This is for specialized uses.

$e->get_html_filtered();

get_date_pulled()

Get the date the email was pulled from the server and put into this object.

$e->get_date_pulled();

Detectors - All Return TRUE or FALSE

preg_match_PLAIN($pattern)

TRUE if regular expression matches the fully-decoded PLAIN part of the email message.

$e->preg_match_PLAIN('/spamword/');

preg_match_HTML($pattern)

TRUE if regular expression matches the fully-decoded HTML part of the email message.

$e->preg_match_HTML('/spamword/');

has_PLAIN_not_HTML()

TRUE if the email has a PLAIN part but no HTML part.

$e->has_PLAIN_not_HTML();

Callback functions

fix_MIME_from_sender($from_str)

Specialized. Brute force. Sometimes a certain email sender's client will mess up some aspect of the email. This function identifies a sender and 'fixes' a common MIME problem: the parts are incompletely specified. This function looks for an html open tag in the first 25 lines and rebuilds the email object to use the html data in the HTML property.

$e->fix_MIME_from_sender('steve@aol.com');

put_PLAIN_into_HTML()

Put the PLAIN part data into the HTML property.

$e->put_PLAIN_into_HTML();

wrap_HTML_with_HTML_tags()

Specialized. Brute force. Sometimes emails that are supposed to be HTML don't have html tags. This wraps those.

$e->wrap_HTML_with_HTML_tags();