Webklex / php-imap

PHP-IMAP is a wrapper for common IMAP communication without the need to have the php-imap module installed / enabled. The protocol is completely integrated and therefore supports IMAP IDLE operation and the "new" oAuth authentication process as well.
https://www.php-imap.com
MIT License
308 stars 145 forks source link

getTextBody() return header #492

Open vkamelin opened 5 months ago

vkamelin commented 5 months ago

getTextBody() return header

$cm = new ClientManager($options = []);

$client = $cm->make([
    'host'          => '***',
    'port'          => ***,
    'encryption'    => 'ssl',
    'validate_cert' => true,
    'username'      => '***',
    'password'      => '***',
    'protocol'      => 'pop3'
]);

$client->connect();

if ($client->isConnected()) {
    $folder = $client->getFolder('INBOX');
    $folderInfo = $folder->examine();
    $latestUid = $folderInfo['exists'];
    $query = $folder->query();

    $latestMessage = $query->getMessage($latestUid);
    $max = $latestUid - 1;

        for ($i = $max; $i > ($latestUid - 20); $i--) {
            $message = $query->getMessage($i);

            file_put_contents('data' . $i . '.txt', $message->getTextBody());
            file_put_contents('data' . $i . '.html', $message->getHTMLBody());

        }

    $account->latest_message_id = $latestMessage->getMessageId();

    $client->disconnect();
}

return this:

Content-Type: multipart/alternative; boundar
Over the years, I've had several folks tell me they missed out on the OG Font Awesome Pro Kickstarter. So I promised I'd do my best to make sure folks know when we ran our next campaign. And, it's been a lot of emails, but you only get one shot at some things in life. Like backing the Web Awesome Kickstarter [https://www.kickstarter.com/projects/fontawesome/web-awesome?ref=awcg8w], ending in just 6 hours.

After the Kickstarter ends, Web Awesome Pro goes from $99/yr to preorder pricing at $159/yr. And all Font Awesome Pro deals disappear. It's the last chance to get this price.

Become a Pro Backer → [https://www.kickstarter.com/projects/fontawesome/web-awesome?ref=awcg8w]

https://fontawesome.com

Font Awesome
307 S. Main St. | Suite 202
Bentonville, AR 72712, USA