minetro/imap

This package is abandoned and no longer maintained. The author suggests using the contributte/mail package instead.

Simple IMAP wrapper

Fund package maintenance!
f3l1x

1.1.1 2015-03-25 11:29 UTC

This package is auto-updated.

Last update: 2021-11-02 12:24:29 UTC


README

Simple IMAP wrapper.

Downloads total Latest stable

Discussion / Help

Join the chat

Install

$ composer require minetro/imap:~1.1.0

Usage

use Minetro\Imap\ImapReader;

$reader = new ImapReader('{yourdomain.cz:143/imap}INBOX', $username, $password);
$emails = $reader->read(ImapReader::CRITERIA_UNSEEN);

// Iterate all emails
foreach ($emails as $email) {
    
    // Iterate all email parts
    for ($i = 0; $i < $email->countBodies(); $i++) {
        
        // Get text (encode with right encoding..)
        $text = $email->getBodySectionText($i);
        
        echo $text;
    }
}