note 48352 added to function.imap-fetchstructure

From: Date: Mon, 20 Dec 2004 15:40:16 +0000
Subject: note 48352 added to function.imap-fetchstructure
Groups: php.notes 
Request: Send a blank email to php-notes+get-82089@lists.php.net to get a copy of this message
Hey people, get the message attachments with this code: <?php $mbox = imap_open("$imap_server".$f,$name,$pass); // delibertely choose a message with an attachment $info = imap_fetchstructure($mbox, $mno); // find out how may parts the object has $numparts = count($info->parts); $i=0; // find if multipart message if ($numparts >1) { echo "<b>More than one part</b><br><br>"; foreach ($info->parts as $part) { if ($part->disposition == "INLINE") printf("Inline message has %s lines<BR>", $part->lines); elseif ($part->disposition == "attachment") { $i++; echo $i." Attachment/s found!<br>"; echo "Filename: ".$part->dparameters[0]->value."<br><br>"; } } } else echo "Only one part"; imap_close($mbox); ?> ---- Manual Page -- http://www.php.net/manual/en/function.imap-fetchstructure.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+48352 Delete -- http://master.php.net/manage/user-notes.php?action=delete+48352&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48352&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48352&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48352&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48352&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48352&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+48352&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#82089) next »