Smiling Souls

Steeped in the delicious tea like leaves of anthroposophy for the evolving soul.


str _getDefaultPid(int &$mid[, str $get_mime[, $attempt = 1]])

Searches structure defined in Mail_IMAP::_declareParts() for the top-level default message part id. Attempts to find a text/html part by default, if no text/html part is found, automatically attempts to find a text/plain part next. This may be reversed to find a text/plain part by default and a text/html part if a text/plain part could not be found by specifying the default MIME type in the $get_mime argument, which is passed to Mail_IMAP::_getDefaultPid() automatically via calling on the Mail_IMAP::getParts() method or the Mail_IMAP::getBody(), which calls on Mail_IMAP::_getDefaultPid() internally via the Mail_IMAP::_checkIfParsed() method. Set the respective $get_mime arguments in Mail_IMAP::getParts() and Mail_IMAP::getBody() to get a text/plain part by default instead of a text/html part.

If no text/plain or text/html part can be found in a message, Mail_IMAP always defaults to '1' as being the default part.

Warning: As a method used internally by Mail_IMAP, Mail_IMAP::_getParts() should not be used directly. Its API has the potential of being changed in future releases, should I find a more efficient approach.

Method summary:

param int &$mid message id
param str $get_mime (optional) default MIME type to look for (one of text/plain or text/html, text/html by default)
param int $attempt (optional) Mail_IMAP::_getDefaultPid() calls on itself recursively, if the preferred default part MIME type specified in $get_mime is not found. This argument is used to track its attempt at finding the default part.
return string Default top level message part id.
access private


There are no comments posted at this time.

Leave a Comment

Simple HTML is allowed: <code>, <b>, <i>, <u>, <var>, <strong>, <em>, <blockquote>, <ul>, <ol>, <li>, <p> (no attributes). All spacing and line breaks in your comment will be preserved.

* All comments are moderated and are subject to approval.
Your comment will appear once it has been approved.
Posting multiple times will not expedite the approval process.

Comments are closed at this time.

© Copyright 2015 Hot Toddy, All Rights Reserved.