PHP code example of zoldia / imap-mail-downloader

1. Go to this page and download the library: Download zoldia/imap-mail-downloader 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/ */

    

zoldia / imap-mail-downloader example snippets

 php
use Tomaj\ImapMailDownloader\Downloader;
use Tomaj\ImapMailDownloader\MailCriteria;
use Tomaj\ImapMailDownloader\Email;

$downloader = new Downloader('*imap host*', *port*, '*username*', '*password*');

$criteria = new MailCriteria();
$criteria->setFrom('[email protected]');
$downloader->fetch($criteria, function(Email $email) {
	print_r($email);
	return true;
});