CSS: Providing seven essential vitamins and minerals since 1996.
Have a steaming hot, delicious slice of Standards.

Mail_IMAP::getRelatedParts()

array|FALSE getRelatedParts(int &$mid, str &$pid = '0'[, array $secureMIME = array()])

Retrieves related parts if the message is a multipart/related message, returns FALSE if there are no related parts.

Limiting the types of files with the $secureMIME argument

The optional $secureMIME argument allows the types of files allowed in a multipart/related message to be limited. This feature can be used to prevent the browser from automatically downloading potentially malicious files embedded in a message.

connect('imap://'.urlencode('user@domain.com').':password@mail.example.com:143/INBOX')) { echo "Error: Unable to build a connection.
"; echo $msg->alerts(); echo $msg->errors(); // See if ErrorStack has any errors. if ($msg->error->hasErrors()) { echo "
 ";
          var_dump($msg->error->getErrors(TRUE));
          echo "
"; } } // Get Parts $msg->getParts($_GET['mid'], $_GET['pid']); // Get Related Parts // The MIME types of the related parts are limited in the $secureMIME argument. $related = $msg->getRelatedParts($_GET['mid'], $_GET['pid'], array('text/plain', 'text/html', 'text/css', 'image/jpeg', 'image/pjpeg', 'image/gif', 'image/png', 'image/x-png', 'application/xml', 'application/xhtml+xml', 'text/xml')); if ($related) { // Do your own CID replacement algorithm // Dump information to see how it is structured echo "
 ";
      var_dump($related);
      echo "
"; } ?>

Method summary:

param int &$mid message id
param str &$pid part id.
param bool $secureMIME (optional) See above.
return array|FALSE
throws ErrorStack: Message structure does not exist. The method was unable to find the message structure associated with the message id passed.
access public

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.

PHP Powered XHTML 1.0 CSS
Copyright © 1998-2012 Richard York, All Rights Reserved.