1. Go to this page and download the library: Download morton1117/mail 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/ */
morton1117 / mail example snippets
$mail = new \Sxstem\Mails\Imap(username, passwork, [mailbox]); //The mailbox defaults to inbox
$result = $mail->getFolder(); //get folder
//$result = $mail->getUid(); //before this,you can use $mail->setBeginDate(),$mail->setEndDate() to set bigin date, end date
//$result = $mail->getHeader($uid); //Not passing the uid means getting the headers for all messages under the current mailbox
//$result = $mail->getMsgnoByUid($uid);
//$result = $mail->getBody($msgno);
//$result = $mail->setFolder($mailbox); //reconnect imap
$mail->imapClose();