note 43244 added to function.imap-fetchstructure

From: Date: Tue, 15 Jun 2004 12:15:56 +0000
Subject: note 43244 added to function.imap-fetchstructure
Groups: php.notes 
Request: Send a blank email to php-notes+get-71096@lists.php.net to get a copy of this message
I have written a code that check's for attachments. There is a slight problem with the above code; when you send a mail with a .txt document as attachment the type will be 0 and so there won't be a attachment found. I check for the disposition of the body part witch can be inline or attachment. If this is an attachment he will display it. You an also mix up both codes by checking on the type and the disposition. ////////////////////////////////// /// $mbox = connection /// $a_mails_sort[$i] = message id $structuur = imap_fetchstructure($mbox,$a_mails_sort[$i]); $bericht_delen=$structuur->parts; for($i_delen = 0; $i_delen<=count($bericht_delen);$i_delen++) { if($bericht_delen[$i_delen]->disposition == "attachment") { $attachment = "OK"; }// end if }//end for ---- Manual Page -- http://www.php.net/manual/en/function.imap-fetchstructure.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+43244 Delete -- http://master.php.net/manage/user-notes.php?action=delete+43244&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+43244&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#71096) next »