Doc #62957 [Opn->Nab]: i need parameters list on imap_fetchbody for section
| From: | aharvey@php.net | Date: | Tue, 28 Aug 2012 13:44:46 +0000 |
| Subject: | Doc #62957 [Opn->Nab]: i need parameters list on imap_fetchbody for section | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-8781@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=62957&edit=1
ID: 62957
Updated by: aharvey@php.net
Reported by: milindmore22 at gmail dot com
Summary: i need parameters list on imap_fetchbody for section
-Status: Open
+Status: Not a bug
Type: Documentation Problem
Package: *General Issues
Operating System: Windows XP
PHP Version: 5.3.16
Block user comment: N
Private report: N
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2012-08-28 13:00:35] milindmore22 at gmail dot com
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 this bug report at https://bugs.php.net/bug.php?id=62957&edit=1