getAttachment() public method

Return the content of a specific MIME part of the specified message.
public getAttachment ( string $mailbox, string $uid, string $part ) : Horde_Mime_Part
$mailbox string The mailbox name.
$uid string The message UID.
$part string The MIME part identifier.
return Horde_Mime_Part The attachment data
Example #1
0
 /**
  * Return the specified attachment.
  *
  * @param string $name  The attachment identifier. For this driver, this
  *                      consists of 'mailbox:uid:mimepart'
  * @param array $options  Any options requested. Currently supported:
  *  - stream: (boolean) Return a stream resource for the mime contents.
  *            DEFAULT: true (Return a stream resource for the 'data' value).
  *
  * @return array  The attachment in the form of an array with the following
  *                structure:
  * array('content-type' => {the content-type of the attachement},
  *       'data'         => {the raw attachment data})
  */
 public function getAttachment($name, array $options = array())
 {
     $options = array_merge(array('stream' => true), $options);
     list($mailbox, $uid, $part) = explode(':', $name);
     $atc = $this->_imap->getAttachment($mailbox, $uid, $part);
     return array('content-type' => $atc->getType(), 'data' => $atc->getContents(array('stream' => $options['stream'])));
 }