note 35692 modified in function.imap-body by didou

From: Date: Thu, 11 Sep 2003 10:19:20 +0000
Subject: note 35692 modified in function.imap-body by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-56061@lists.php.net to get a copy of this message
Usually, not multipart or 'zero-parts' messages are displayed with imap_body, but you may have a multipart message with no parts. For this type, displaying with imap_body, you may get unwanted data(like 'this is a MIME...' and boundary string), so a better solution is use imap_fetchbody. <?php // Type 1 is 'multipart' if(($struct->type==1) && (sizeOf($struct->parts)==0)) { echo(imap_fetchbody($mailConn,$msg,"1")); } ?> Where $struct is the object returned by imap_fetchstructure. --was-- Usually, not multipart or 'zero-parts' messages are displayed with imap_body, but you may have a multipart message with no parts. For this type, displaying with imap_body, you may get unwanted data(like 'this is a MIME...' and boundary string), so a better solution is use imap_fetchbody. // Type 1 is 'multipart' if(($struct->type==1) && (sizeOf($struct->parts)==0)) { echo(imap_fetchbody($mailConn,$msg,"1")); } Where $struct is the object returned by imap_fetchstructure. http://www.php.net/manual/en/function.imap-body.php

« previous php.notes (#56061) next »