dev-master
9999999-devPHP Email Reader (using IMAP) and Parser (using mimeDecode)
The Requires
- php >=5.4.0
- ext-imap *
- ext-mbstring *
- php-mime-mail-parser/php-mime-mail-parser 2.9.1
Wallogit.com
2017 © Pedro Peláez
PHP Email Reader (using IMAP) and Parser (using mimeDecode)
It does something that should be so simple but turns out to be very complex using PHP: reading emails from a mailbox using IMAP and then parsing the returned emails into a dev-friendly object., (*1)
Simply require both classes (Email_Reader and Email_Parser) inside your code., (*2)
Email_Reader is used to open an IMAP stream to a mailbox and then fetch messages., (*3)
get_messages(); $unread = $reader->get_unread(); ?>
Email_Parser is used within Email_Reader to be able to decode the returned emails. It can also be used by itself to read emails, for example, from php://std in the case of email piping., (*4)
#! /usr/bin/php -q from, $email->subject, $email->body); ?>
In order to write these classes, I had a lot of reading of other people's work and I would like to thank the following repository owners., (*5)
Jonathan Roy, web developper at OptimumWeb, (*6)
Twitter: @jonathanroy, (*7)
PHP Email Reader (using IMAP) and Parser (using mimeDecode)