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: 2013-06-25 18:46 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:
Status: Open Package: IMAP related
PHP Version: 5.5.0 OS: windows 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: abhinav dot octane at gmail dot com
New email:
PHP Version: OS:

 

 [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));
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Sep 17 11:01:26 2019 UTC