1. Go to this page and download the library: Download haogood/php-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/ */
haogood / php-imap example snippets
use IMAP\IMAPMailbox;
$host = '{imap.gmail.com:993/imap/ssl}';
$user = '[email protected]';
$pwd = '******';
$mailbox = new IMAPMailbox($host, $user, $pwd);