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.
Parameters:
|
string |
$input: |
The input to decode |
API Tags:
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.
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 |
API Tags:
| Return: | results |
| Access: | public |
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.
Parameters:
|
object |
$structure: |
The structure to go through |
|
string |
$mime_number: |
Internal use only. |
|
|
&$structure: |
|
|
|
$no_refs: |
|
|
|
$prepend: |
|
API Tags:
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; }
API Tags:
| Return: | array of recipeint, headers,body or Pear_Error |
| Access: | public |
Information Tags:
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.
Parameters:
|
object Input |
$input: |
to convert to xml. This should be the output of the Mail_mimeDecode::decode function |
API Tags:
| Return: | XML version of input |
| Access: | public |
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.
Parameters:
|
string |
$input: |
Input body to look for attahcments in |
API Tags:
| Return: | Decoded bodies, filenames and permissions |
| Access: | public |
Information Tags: