tedious / Fetch

An IMAP library for PHP
http://www.tedivm.com
Other
503 stars 160 forks source link

Allow get raw unparsed message (with all headers and body) #202

Open Koc opened 6 years ago

Koc commented 6 years ago

Please implement Message::__toString() which returns unparsed email

drjayvee commented 2 years ago

According to this StackOverflow post, it should be as simple as

public function __toString()
{
    $imap = $this->imapConnection->getImapStream();
    return imap_fetchheader($imap, $this->uid, FT_PREFETCHTEXT) .
        "\n" .
        imap_body($imap, $this->uid)
    ;
}