I use IMAP to read mails from my mail server.
But, I have huge number of mails in my Inbox, every time i try to test, it take a minutes to load.
I only want New, Unread, First 10 E-mails only.
For Reading Email :
// open IMAP connection
$dns = "{imap.smtp.domain:993/imap/ssl}INBOX";
$email = "[email protected]";
$password = "**********";
$mbox = imap_open($dns, $email, $password);
$MC = imap_check($mbox);
if (!$mbox)
die("COULD NOT OPEN MAILBOX!\r\n");
$result = imap_fetch_overview($mbox,"1:{$MC->Nmsgs}",0);
echo "<table>";
$i=1;
foreach ($result as $overview) {
if($i == 10) break;
echo "<tr>"
."<td>".$overview->msgno."</td>"
."<td>".$overview->uid."</td>"
."<td>".$overview->date."</td>"
."<td>".$overview->udate."</td>"
."<td>".$overview->from."</td>"
."<td>".$overview->to."</td>"
."<td>".$overview->size."</td>"
."<td>".$overview->subject."</td>"
."</tr>";
$i++;
}
echo "</table>";
It returns only 10, but it takes huge time.
I need simple and quick read of email.
Is it Possible ?
Or any other solutions ?