php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #37396 Feature request for imap_fetchstructure
Submitted: 2006-05-10 11:47 UTC Modified: 2020-10-16 14:51 UTC
From: lacak at users dot sourceforge dot net Assigned: cmb (profile)
Status: Feedback Package: IMAP related
PHP Version: 5.1.4 OS: Windows
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-05-10 11:47 UTC] lacak at users dot sourceforge dot net
Description:
------------
It would be nice if function imap_fetchstructure() will be able to return object extended by "part_number", which may be used as paramater in imap_fetchbody().

So I can walk throught structure of mail message using imap_fetchstructure() and obtain data by single call imap_fetchbody().

Today I must relatively complicate build part_number.

Thanks
-Laco


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-02-21 21:26 UTC] jani@php.net
-Package: Feature/Change Request +Package: IMAP related
 [2020-10-16 14:51 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2020-10-16 14:51 UTC] cmb@php.net
Maybe I misunderstand your request, but it doesn't look hard to
add the part numbers yourself:

<?php
function add_part_numbers($structure, $acc = '') {
    if (isset ($structure->parts)) {
        foreach ($structure->parts as $i => $part) {
            $part_number = $acc . ($i + 1);
            $part->part_number = $part_number;
            add_part_numbers($part, "$part_number.");
        }
    }
}

$structure = imap_fetchstructure($imap, 1);
add_part_numbers($structure);
?>
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Oct 21 22:01:23 2020 UTC