Mail_Mime
[ class tree: Mail_Mime ] [ index: Mail_Mime ] [ all elements ]

Class: Mail_mimeDecode

Source Location: /pear/Mail/mimeDecode.php

Class Overview

PEAR
   |
   --Mail_mimeDecode

The Mail_mimeDecode class is used to decode mail/mime messages


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2003-2006 PEAR <pear-group@php.net>

Methods


Inherited Methods

Class: PEAR

PEAR::PEAR()
Constructor. Registers this object in $_PEAR_destructor_object_list for destructor emulation if a destructor object exists.
PEAR::delExpect()
This method deletes all occurences of the specified element from the expected error codes stack.
PEAR::expectError()
This method is used to tell which errors you expect to get.
PEAR::getStaticProperty()
If you have a class that's mostly/entirely static, and you need static
PEAR::isError()
Tell whether a value is a PEAR error.
PEAR::loadExtension()
OS independant PHP extension load. Remember to take care on the correct extension name for case sensitive OSes.
PEAR::popErrorHandling()
Pop the last error handler used
PEAR::popExpect()
This method pops one element off the expected error codes stack.
PEAR::pushErrorHandling()
Push a new error handler on top of the error handler options stack. With this you can easily override the actual error handler for some code and restore it later with popErrorHandling.
PEAR::raiseError()
This method is a wrapper that returns an instance of the configured error class with this object's default error handling applied. If the $mode and $options parameters are not specified, the object's defaults are used.
PEAR::registerShutdownFunc()
Use this function to register a shutdown method for static classes.
PEAR::setErrorHandling()
Sets how errors generated by this object should be handled.
PEAR::staticPopErrorHandling()
PEAR::staticPushErrorHandling()
PEAR::throwError()
Simpler form of raiseError with fewer options. In most cases message, code and userinfo are enough.
PEAR::_PEAR()
Destructor (the emulated type of...). Does nothing right now, but is included for forward compatibility, so subclass destructors should always call it.

Class Details

[line 91]
The Mail_mimeDecode class is used to decode mail/mime messages

This class will parse a raw mime email and return the structure. Returned structure is similar to that returned by imap_fetchstructure().

+----------------------------- IMPORTANT ------------------------------+ | Usage of this class compared to native php extensions such as | | mailparse or imap, is slow and may be feature deficient. If available| | you are STRONGLY recommended to use the php extensions. | +----------------------------------------------------------------------+




Tags:

author:  Sean Coates <sean@php.net>
author:  George Schlossnagle <george@omniti.com>
author:  Richard Heyes <richard@phpguru.org>
author:  Cipriano Groenendal <cipri@php.net>
version:  Release: @package_version@
copyright:  2003-2006 PEAR <pear-group@php.net>
link:  http://pear.php.net/package/Mail_mime
license:  BSD License


[ Top ]


Class Methods


constructor Mail_mimeDecode [line 159]

Mail_mimeDecode Mail_mimeDecode( string $input)

Constructor.

Sets up the object, initialise the variables, and splits and stores the header and body of the input.




Tags:

access:  public


Parameters:

string   $input   The input to decode

[ Top ]

method decode [line 187]

object Decoded decode( [array $params = null])

Begins the decoding process. If called statically it will create an object and call the decode() method of it.



Tags:

return:  results
access:  public


Parameters:

array   $params   An array of various parameters that determine various things: include_bodies - Whether to include the body in the returned object. decode_bodies - Whether to decode the bodies of the parts. (Transfer encoding) decode_headers - Whether to decode headers input - If called statically, this will be treated as the input

[ Top ]

method getMimeNumbers [line 356]

array &getMimeNumbers( &$structure, [ $no_refs = false], [string $mime_number = ''], [ $prepend = ''], object $structure)

Given the output of the above function, this will return an array of references to the parts, indexed by mime number.



Tags:

return:  Mime numbers


Parameters:

object   $structure   The structure to go through
string   $mime_number   Internal use only.
   &$structure  
   $no_refs  
   $prepend  

[ Top ]

method getSendArray [line 707]

mixed getSendArray( )

getSendArray() returns the arguments required for Mail::send() used to build the arguments for a mail::send() call

Usage: $mailtext = Full email (for example generated by a template) $decoder = new Mail_mimeDecode($mailtext); $parts = $decoder->getSendArray(); if (!PEAR::isError($parts) { list($recipents,$headers,$body) = $parts; $mail = Mail::factory('smtp'); $mail->send($recipents,$headers,$body); } else { echo $parts->message; }




Tags:

return:  array of recipeint, headers,body or Pear_Error
author:  Alan Knowles <alan@akbkhome.com>
access:  public


[ Top ]

method getXML [line 751]

string getXML( object Input $input)

Returns a xml copy of the output of Mail_mimeDecode::decode. Pass the output in as the argument. This function can be called statically. Eg:

$output = $obj->decode(); $xml = Mail_mimeDecode::getXML($output);

The DTD used for this should have been in the package. Or alternatively you can get it from cvs, or here: http://www.phpguru.org/xmail/xmail.dtd.




Tags:

return:  XML version of input
access:  public


Parameters:

object Input   $input   to convert to xml. This should be the output of the Mail_mimeDecode::decode function

[ Top ]

method uudecode [line 628]

array &uudecode( string $input)

Checks the input for uuencoded files and returns an array of them. Can be called statically, eg:

$files =& Mail_mimeDecode::uudecode($some_text);

It will check for the begin 666 ... end syntax however and won't just blindly decode whatever you pass it.




Tags:

return:  Decoded bodies, filenames and permissions
author:  Unknown
access:  public


Parameters:

string   $input   Input body to look for attahcments in

[ Top ]


Documentation generated on Sun, 08 Jan 2012 17:51:54 +0100 by phpDocumentor 1.4.3