|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #64768 mail parser can't get total contents of "From" and "To"
Submitted: 2013-05-03 03:05 UTC Modified: -
From: bill dot yang at watchguard dot com Assigned:
Status: Open Package: *Mail Related
PHP Version: 5.5.0beta4 OS: freebsd 7.0
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2013-05-03 03:05 UTC] bill dot yang at watchguard dot com
From manual page:
I use php5 pcre.
I don't know the reason, perhaps it's because configure of mail parse.

Test script:
    function _process_mail_file($qfile)
        // parse the message and return a mime message resource
        $mime = mailparse_msg_parse_file($qfile);
        // get message structure
        $struct = mailparse_msg_get_structure($mime);
        // get message parts based on message structure
        $parts = array();
        foreach ($struct as $part_id) {
            $part = mailparse_msg_get_part($mime, $part_id);
//Following line when print_r($parts[$part_id]); the mail header "From" and "To" contents just have user name, don't have email address. 
            $parts[$part_id] = mailparse_msg_get_part_data($part);


        // free mime resource

        return $parts;

Expected result:
have email address for "From" and "To"

Actual result:
There aren't mail address.


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Oct 26 00:01:23 2020 UTC