petnovcz/imap

简单的 IMAP 封装 - 带事件

1.2.2 2016-09-10 14:13 UTC

This package is not auto-updated.

Last update: 2024-09-14 19:42:05 UTC


README

简单的 IMAP 封装。

Downloads total Latest stable

讨论/帮助

Join the chat at https://gitter.im/Markette/Gopay

安装

$ composer require petnov/imap:~1.1.0

使用

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