Using PHP to retrieve sender's email address from gmail inbox?

hameem

Elite Member
Joined
Jul 21, 2011
Messages
1,914
Reaction score
1,010
I have searched around a bit.

I can't seem to find an element in the array returned by the PHP function "imap_fetch_overview" that will give me the email sender's email address in the inbox (or whichever folder). The "from" element gives the sender's name.

I would appreciate it very much if anyone could help me on this.
 
it's (almost) impossible to help you without you providing some code.. But, you should be able to get the address if u use

Code:
$var = imap_headerinfo($imap, $msg);
$fromaddr = $var->from[0]->mailbox . "@" . $var->from[0]->host;

Good luck
 
Back
Top