Example 46-1. Decode an email
<?php
require_once 'Mail/mimeDecode.php';
...
$params['include_bodies'] = true;
$params['decode_bodies'] = true;
$params['decode_headers'] = true;
$decoder = new Mail_mimeDecode($input);
$structure = $decoder->decode($params);
?> |
This example calls the decode function statically (ie no object,
straight function call) and then passes the structure to the
getXML()
function.
<?php
...
$params['include_bodies'] = true;
$params['decode_bodies'] = false;
$params['decode_headers'] = true;
$params['input'] = $input;
$params['crlf'] = "\r\n";
$structure = Mail_mimeDecode::decode($params);
$xml = Mail_mimeDecode::getXML($structure);
?> |