Jump to content

Recommended Posts

I have 2 gmail accounts and am forwarding all msgs from them  to my other single mailbox.

 

Now, I access my mailbox using imap functions.

 

Is there any function/way using which i can know which mail is forwarded by which gmail id?

 

Note:

My Attempts with imap_fetch_overview were semi-success, except for one case. (Please read the steps below)

 

1. if someone sends an email to me ..in this fashion -> [To:someotheremail@abc.com,myemail@gmail.com]

2. this mail gets forwarded to my mailbox from gmail.

3. using imap_fetch_overview i echo $overview->to, which shows someotheremail@abc.com instead of myemail@gm....

 

i think i CAN use msg header, but i am clueless .. HOW!?

 

 

 

 

 

Use toaddress from the imap_headerinfo that will give you all the email address send to..

to put them into an array you could do this

*untested*

<?php
$info = imap_headerinfo($m_mail, $msgid)
preg_match_all('/\s?[^,]*/', $info->toaddress , $toaddress);
$toaddress= $toaddress[1];
echo "<pre>";print_r($toaddress);
?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.