indianyogi Posted January 25, 2009 Share Posted January 25, 2009 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!? Quote Link to comment https://forums.phpfreaks.com/topic/142348-how-to-knowthe-forwarder-email-using-imap-functions/ Share on other sites More sharing options...
MadTechie Posted January 25, 2009 Share Posted January 25, 2009 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); ?> Quote Link to comment https://forums.phpfreaks.com/topic/142348-how-to-knowthe-forwarder-email-using-imap-functions/#findComment-745863 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.