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:[email protected],[email protected]] 2. this mail gets forwarded to my mailbox from gmail. 3. using imap_fetch_overview i echo $overview->to, which shows [email protected] instead of myemail@gm.... i think i CAN use msg header, but i am clueless .. HOW!? 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); ?> 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
Archived
This topic is now archived and is closed to further replies.