Search code examples
zend-frameworkemailgmailimapsender

How can I get sender email address while using zend imap


I have uploaded the whole screenshot of the mail which is sent to my gmail id. But fetch at my website using zend imap.

here I am not able to figure out the exact sender email address header.

as you can see I am getting sender name not email in 'From' Header.

Any Ideas?

This is Screenshot: enter image description here


Solution

  • Try this:

    $header = imap_rfc822_parse_headers($storage->getRawHeader($email_id));
    $from_email = $header->from[0]->mailbox . "@" . $header->from[0]->host;
    

    Works for me.