Getting message-id value from gmail imap using php

I use the standard imap functions to capture emails, I need to keep track of the message identifier (and the links and in response to) to build the streams. I reply to messages via smtp, preserving the old object, but in my web interface it is not grouped with others. If I add the In-Reply-To header, everything is fine.

The problem is that I can not get the values ​​of Message-ID, References, In-Reply-To (but they are present in the web interface). I tried different functions (imap_headerinfo, imap_fetchheader, imap_fetch_overview), but all these values ​​are empty.

Please, help!

+5
source share
1 answer

, :

<OTJMCQtXnqgMaP1rLJi-cD9IvuH+xuVndE-DoWAZB0cbdffqHdw@mail.gmail.com>

HTML-, , :

$this->mbox = imap_open('{imap.gmail.com:993/imap/ssl}', $email, $password);
$headers = imap_header($this->mbox, 1);
echo htmlentities($headers->message_id);

, print_r:

$this->mbox = imap_open('{imap.gmail.com:993/imap/ssl}', $email, $password);
ob_start(); 
print_r(imap_header($this->mbox, 1));
print_r(imap_fetch_overview($this->mbox, 1));
print_r(imap_fetchheader($this->mbox, 1));
echo htmlentities(ob_get_clean());
+5

All Articles