php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45638 Issues with imap_header
Submitted: 2008-07-27 14:53 UTC Modified: 2008-07-27 16:12 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: arun dot magzion at gmail dot com Assigned:
Status: Not a bug Package: IMAP related
PHP Version: 5.2.5 OS: Windows
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:
16 - 1 = ?
Subscribe to this entry?

 
 [2008-07-27 14:53 UTC] arun dot magzion at gmail dot com
Description:
------------
THe imap_header funtion return the multiple email address for cc, bcc but not with the to email address.

Reproduce code:
---------------
$ccbcc = imap_header($mbox,$msgid);
if(isset($ccbcc->to)){

	$to = "";
	foreach($ccbcc->to as $mto) {
		if(isset($mto->personal)) {
			$to = $to. $mto->personal;
		}
		if(isset($mto->mailbox) && isset($mto->host)) {
			$to = $to."< ".$mto->mailbox."@".$mto->host." >". ",";
		}
	}
	$to = substr($to, 0,strlen($to)-1);		
}


Expected result:
----------------
info@magzion.com, info@grafotech.org

Actual result:
--------------
info@magzion.com

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-27 15:27 UTC] jani@php.net
This is not enough information to even see whether this is expected or really a bug. I suggest you try this first:

$ccbcc = imap_header($mbox,$msgid);
var_dump($ccbcc);

 [2008-07-27 15:37 UTC] arun dot magzion at gmail dot com
Dear Team,
Consider this example,
I sent email to 3 different email address and cc'ed to another different two email address. When I tried to receive all the email address using imap_header i got the 2 cc'ed email address but not the 3 to address with the same loop and functions.

Please find the output for 
$ccbcc = imap_header($mbox,$msgid);
print_r($ccbcc);

Here Iam getting the expected output for cc but not with the to address whereas the same is fine with Gmail.

stdClass Object
(
    [date] =&gt; Sun, 27 Jul 2008 21:04:37 +0530
    [Date] =&gt; Sun, 27 Jul 2008 21:04:37 +0530
    [subject] =&gt; Testing for multiple email address
    [Subject] =&gt; Testing for multiple email address
    [message_id] =&gt; &lt;9bfeef6e0807270834t58af4da7v907d2fa51a95c316@mail.gmail.com&gt;
    [toaddress] =&gt; info@grafotech.org
    [to] =&gt; Array
        (
            [0] =&gt; stdClass Object
                (
                    [mailbox] =&gt; info
                    [host] =&gt; grafotech.org
                )

        )

    [fromaddress] =&gt; Arunkumar Vijayakumar <arun.magzion@gmail.com>

    [from] =&gt; Array
        (
            [0] =&gt; stdClass Object
                (
                    [personal] =&gt; Arunkumar Vijayakumar
                    [mailbox] =&gt; arun.magzion
                    [host] =&gt; gmail.com
                )

        )

    [ccaddress] =&gt; mohan@grafotech.org, arun.magzion@gmail.com
    [cc] =&gt; Array
        (
            [0] =&gt; stdClass Object
                (
                    [mailbox] =&gt; mohan
                    [host] =&gt; grafotech.org
                )

            [1] =&gt; stdClass Object
                (
                    [mailbox] =&gt; arun.magzion
                    [host] =&gt; gmail.com
                )

        )

    [reply_toaddress] =&gt; Arunkumar Vijayakumar <arun.magzion@gmail.com>

    [reply_to] =&gt; Array
        (
            [0] =&gt; stdClass Object
                (
                    [personal] =&gt; Arunkumar Vijayakumar
                    [mailbox] =&gt; arun.magzion
                    [host] =&gt; gmail.com
                )

        )

    [senderaddress] =&gt; Arunkumar Vijayakumar <arun.magzion@gmail.com><title>Grafotech(R) Magzion Mail</title>
    [sender] =&gt; Array
        (
            [0] =&gt; stdClass Object
                (
                    [personal] =&gt; Arunkumar Vijayakumar
                    [mailbox] =&gt; arun.magzion
                    [host] =&gt; gmail.com
                )

        )

    [Recent] =&gt;  
    [Unseen] =&gt;  
    [Flagged] =&gt;  
    [Answered] =&gt;  
    [Deleted] =&gt;  
    [Draft] =&gt;  
    [Msgno] =&gt;   42
    [MailDate] =&gt; 27-Jul-2008 10:34:55 -0500
    [Size] =&gt; 2331
    [udate] =&gt; 1217172895
)
 [2008-07-27 15:56 UTC] jani@php.net
Unfortunately this is how c-client works. PHP merely wraps around the functions provided by that library. 
 [2008-07-27 16:12 UTC] arun dot magzion at gmail dot com
Dear Team
Your reply is not clear, If it so then thats a bug right ?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 10:01:28 2024 UTC