Doc #62957 [NEW]: i need parameters list on imap_fetchbody for section
| From: | milindmore22 at gmail dot com | Date: | Tue, 28 Aug 2012 13:00:36 +0000 |
| Subject: | Doc #62957 [NEW]: i need parameters list on imap_fetchbody for section | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-8780@lists.php.net to get a copy of this message | ||
From: milindmore22 at gmail dot com
Operating system: Windows XP
PHP version: 5.3.16
Package: *General Issues
Bug Type: Documentation Problem
Bug description:i need parameters list on imap_fetchbody for section
Description:
------------
---
From manual page:
http://www.php.net/function.imap-fetchbody#refsect1-function.imap-fetchbody-parameters
---
I am trying to get emails from inbox of gmail sent to me by particular
email id
although i got output but in strange format because of parameter section
see below
imap_fetchbody ( resource $imap_stream , int $msg_number , string $section
[, int $options = 0 ] )
please can you give me detail of parameters and what actually they do when
i put 0 it gives me nothing when i put 1 gives me plain text when i put 2
gives me html with too many eqaul(=) signs
Test script:
---------------
<?php
set_time_limit(0);
$imap = imap_open('{imap.gmail.com:993/imap/ssl}INBOX',
'youremail', 'yourpassword');
$subject = 'searchbyemail@gmail.com';
$threads = array();
//remove re: and fwd:
//$subject = trim(preg_replace("/Re\:|re\:|RE\:|Fwd\:|fwd\:|FWD\:/i", '',
$subject));
//search for subject in current mailbox
$results = imap_search($imap, 'FROM "'.$subject.'"', SE_UID);
//because results can be false
if(is_array($results)) {
//now get all the emails details that were found
$emails = imap_fetch_overview($imap, implode(',', $results), FT_UID);
//foreach email
foreach ($emails as $email) {
/* output the email header information */
//add to threads
//we use date as the key because later we will sort it
$message.=imap_fetchbody($imap,$email->uid,2,FT_UID);
$threads[strtotime($email->date)] = $email;
$message.='<hr />';
}
}
krsort($threads);
echo $message;
//echo '<pre>'.print_r($threads, true).'</pre>';
exit;
?>
Expected result:
----------------
Hi Milind,
I haven't been able to check your mail. I should do it on Monday and able
to call Adhish / you.
Regards,
Ajay
On Mon, Aug 13, 2012 at 3:51 PM, milind more <strange@gmail.in> wrote:
Respected Sir,
As per our discussion for the Student Information System, we have
started working on it
as per SDLC's first stage we have collected Requirement from you,
please see attachment and clear out requirements also attached ER-Diagram
for same please revert back with your opinion.
--
Regards,
Milind More
--
Ajay Potnis
Home: +91-20-2539-4004
Cellular: +91-9423-531-321
Actual result:
--------------
Hi Milind,
I haven't been able to check your mail. I should do = it on Monday and able
to call Adhish / you.
Regards,
Ajay
<= br>
On Mon, Aug 13, 2012 at 3:51 PM, milind m= ore <milind.more@synergysoft.in>
wrote:
Respected Sir,
As per our discussion for = the Student Information System, we have
started working on it
as per SDL= C's first stage we have collected Requirement from you,
please see atta= chment and clear out requirements also attached ER-Diagram
for same please = revert back with your opinion.
--
Regards,
Milind More
--
Ajay Potn= is
Home: +91-20-2539-4004
Cellular: +91-9423-531-321
--
Edit bug report at https://bugs.php.net/bug.php?id=62957&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=62957&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=62957&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=62957&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=62957&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62957&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=62957&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=62957&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=62957&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=62957&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=62957&r=support
Expected behavior: https://bugs.php.net/fix.php?id=62957&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=62957&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=62957&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=62957&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=62957&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=62957&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=62957&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=62957&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=62957&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=62957&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=62957&r=mysqlcfg