note 42622 added to function.imap-fetchbody
| From: | Sito at rn2 dot php dot net | Date: | Mon, 24 May 2004 08:54:17 +0000 |
| Subject: | note 42622 added to function.imap-fetchbody | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-70014@lists.php.net to get a copy of this message | ||
Better, a fix on a fix... ;)
function read_all_parts($uid){
global $mime,$ret_info,$enc;
$mime =
array("text","multipart","message","application","audio",
"image","video","other","unknow");
$enc = array("7BIT","8BIT","BINARY","BASE64",
"QUOTED-PRINTABLE","OTHER");
$struct = imap_fetchstructure( $this -> Link, $uid );
$ret_info = array();
function scan($struct,$subkey){
global $mime,$enc,$ret_info;
foreach($struct as $key => $value){
if($subkey!=0){
$pid = $subkey.".".($key+1); }
else { $pid = ($key+1); }
$ret_info[]['pid'] = $pid;
$ret_info[key($ret_info)]['type'] = $mime["$value->type"];
$ret_info[key($ret_info)]['encoding'] = $enc["$value->encoding"];
next($ret_info);
if(($value->parts)!= null) {scan($value->parts,$pid); }
}
}
if(!is_null($struct->parts))
{
scan($struct->parts,0);
}
else
{
print_r($struct);
echo("<hr>");
$ret_info[]['pid']=1;
$ret_info[key($ret_info)]['type']=$mime["$struct->type"];
$ret_info[key($ret_info)]['encoding']=$enc["$struct->encoding"];
}
return $ret_info;
}
----
Manual Page -- http://www.php.net/manual/en/function.imap-fetchbody.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42622
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42622&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42622&report=yes
Search -- http://master.php.net/manage/user-notes.php