note 42633 added to function.imap-fetchbody
| From: | jsimloyahoocom at rn2 dot php dot net | Date: | Mon, 24 May 2004 17:38:17 +0000 |
| Subject: | note 42633 added to function.imap-fetchbody | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-70034@lists.php.net to get a copy of this message | ||
this may be the way, how to obtain all those part_numbers.... even when a message contains another
message attached, and it contains another message attached...
<?
$parttypes = array ("text", "multipart", "message",
"application", "audio", "image", "video",
"other");
function buildparts ($struct, $pno = "") {
global $parttypes;
switch ($struct->type):
case 1:
$r = array (); $i = 1;
foreach ($struct->parts as $part)
$r[] = buildparts ($part, $pno.".".$i++);
return implode (", ", $r);
case 2:
return "{".buildparts ($struct->parts[0], $pno)."}";
default:
return '<a href="?p='.substr ($pno,
1).'">'.$parttypes[$struct->type]."/".strtolower
($struct->subtype)."</a>";
endswitch;
}
$struct = imap_fetchstructure ($pop3mbox, $msguid, FT_UID);
echo buildparts ($struct);
?>
it will print something like:
<a href="?p=1">text/plain</a>, {<a
href="?p=2.1">text/plain</a>, <a
href="?p=2.2">text/html</a>}
----
Manual Page -- http://www.php.net/manual/en/function.imap-fetchbody.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42633
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42633&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42633&report=yes
Search -- http://master.php.net/manage/user-notes.php