#45638 [Opn->Bgs]: Issues with imap_header

From: Date: Sun, 27 Jul 2008 15:56:35 +0000
Subject: #45638 [Opn->Bgs]: Issues with imap_header
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-127323@lists.php.net to get a copy of this message
 ID:               45638
 Updated by:       jani@php.net
 Reported By:      arun dot magzion at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         IMAP related
 Operating System: Windows
 PHP Version:      5.2.5
 New Comment:

Unfortunately this is how c-client works. PHP merely wraps around the
functions provided by that library. 


Previous Comments:
------------------------------------------------------------------------

[2008-07-27 15:37:50] 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] => Sun, 27 Jul 2008 21:04:37 +0530
    [Date] => Sun, 27 Jul 2008 21:04:37 +0530
    [subject] => Testing for multiple email address
    [Subject] => Testing for multiple email address
    [message_id] =>
<9bfeef6e0807270834t58af4da7v907d2fa51a95c316@mail.gmail.com>
    [toaddress] => info@grafotech.org
    [to] => Array
        (
            [0] => stdClass Object
                (
                    [mailbox] => info
                    [host] => 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:27:49] 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 14:53:33] 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


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=45638&edit=1



Thread (6 messages)

« previous php.bugs (#127323) next »