PHP code example of minetro / imap
1. Go to this page and download the library: Download minetro/imap library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
minetro / imap example snippets
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;
}
}