Using PHP IMAP I am able to download all my messages attachments etc from gmail. But when there are multiple recipients in the to address I am only getting a single address. Let me explain it more clearly.
Suppose I have an email address example@gmail.com from where I am downloading all the messages. Now when test@gmail.com sends an email to me I am getting example@gmail.com in the toaddress using function imap_headerinfo. But when test@gmail.com sends the mail to example@gmail.com and example_1@gmail.com then I am not getting this example_1@gmail.com in toaddress or reply_toaddress or cc etc. Below is my sample output for a message
$header = imap_headerinfo($mbox, $msgno);
stdClass Object
(
[date] => Tue, 10 Sep 2013 13:37:49 +0530
[Date] => Tue, 10 Sep 2013 13:37:49 +0530
[subject] => reply all test
[Subject] => reply all test
[message_id] => <CACYeE9OEr+9z-Q5BR69sC=nJR_qQps69-VKWxkL6j2hqKEBo2w@mail.gmail.com>
[toaddress] => example@gmail.com
[to] => Array
(
[0] => stdClass Object
(
[mailbox] => example
[host] => gmail.com
)
)
[fromaddress] => Test <test@gmail.com>
[from] => Array
(
[0] => stdClass Object
(
[personal] => Test
[mailbox] => test
[host] => gmail.com
)
)
[reply_toaddress] => Test <test@gmail.com>
[reply_to] => Array
(
[0] => stdClass Object
(
[personal] => Test
[mailbox] => test
[host] => gmail.com
)
)
[senderaddress] => Test <test@gmail.com>
[sender] => Array
(
[0] => stdClass Object
(
[personal] => Test
[mailbox] => test
[host] => gmail.com
)
)
[Recent] =>
[Unseen] => U
[Flagged] =>
[Answered] =>
[Deleted] =>
[Draft] =>
[Msgno] => 34463
[MailDate] => 10-Sep-2013 08:07:00 +0000
[Size] => 2609
[udate] => 1378800420
)
I want all the recipients address so that I can use them in reply all.
I can clearly see all the to address (AS Cc) in email clients like outlook, thunderbird etc when I click on reply all.