php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #65126 imap_fetchoverview returns all the header fields but for message id
Submitted: 2013-06-25 18:38 UTC Modified: 2020-10-16 13:55 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: abhinav dot octane at gmail dot com Assigned: cmb (profile)
Status: Not a bug Package: IMAP related
PHP Version: 5.5.0 OS: windows 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
33 - 20 = ?
Subscribe to this entry?

 
 [2013-06-25 18:38 UTC] abhinav dot octane at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.imap-fetch-overview#refsect1-
function.imap-fetch-overview-returnvalues

imap_fetchoverview returns all the header fields but for message id there is no 
value, below is the code i am using-:
<?php 

$m_username="example@gmail.com";
$m_password="xxxxx";

$mbox=imap_open('{imap.gmail.com:993/imap/ssl}[Gmail]/Spam', $m_username, 
$m_password);
$MC = imap_check($mbox);

// Fetch an overview for all messages in SPAM
$overview = imap_fetch_overview($mbox,"1:{$MC->Nmsgs}",0);
echo '<pre>';
print_r($overview);
exit;
?>
below is it's output-:
Array
(
    [0] => stdClass Object
        (
            [subject] => hello test
            [from] => ABCD 
            [to] => example@gmail.com
            [date] => Mon, 24 Jun 2013 15:01:07 +0100
            [message_id] => 
            [size] => 1821
            [uid] => 2814
            [msgno] => 1
            [recent] => 0
            [flagged] => 0
            [answered] => 0
            [deleted] => 0
            [seen] => 0
            [draft] => 0
            [udate] => 1372082473
        )

    [1] => stdClass Object
        (
            [subject] => hello test
            [from] => ABCD 
            [to] => example@gmail.com
            [date] => Mon, 24 Jun 2013 15:10:03 +0100
            [message_id] => 
            [size] => 20823
            [uid] => 2815
            [msgno] => 2
            [recent] => 0
            [flagged] => 0
            [answered] => 0
            [deleted] => 0
            [seen] => 0
            [draft] => 0
            [udate] => 1372083053
---
for some other email id this code returns message id but not for all emails out 
of 77 message id is returned for 20


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-06-25 18:46 UTC] abhinav dot octane at gmail dot com
-Package: Scripting Engine problem +Package: IMAP related
 [2013-06-25 18:46 UTC] abhinav dot octane at gmail dot com
any help will be highly appreciated.
 [2013-06-25 23:01 UTC] mattficken@php.net
You should try the Net_IMAP pear package: http://pear.php.net/package/Net_IMAP

Its a pure PHP implementation, not to be confused with Mail_Imap/the 'imap' extension.
 [2016-09-06 09:23 UTC] akhil dot gupta7295 at gmail dot com
It is because the browser is thinking of it as a tag, due to its syntax.
To display it in the browser, use this instead,

echo htmlentities(print_r($overview, true));
 [2020-10-16 13:55 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2020-10-16 13:55 UTC] cmb@php.net
> It is because the browser is thinking of it as a tag, due to its
> syntax.

That.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 16:01:27 2024 UTC