Componette

Componette

f00b4r

f00b4r / imap

Simple PHP IMAP wrapper

download-cloud-line composer require minetro/imap

Imap

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;
    }
}

No release at this moment. Try to create first one.

Componette Componette felix@nette.org