Location: PHPKode > scripts > MicroPHP Mail Checker > microphp-mail-checker/sample.php
<?php

include("mailchk.class.php");
$mail = new Mailchk();
$mail->mailbox = "{your.imap.host:143}";
$mail->username = "username";
$mail->password = "password";
$mail->openMail();

//print_r($mail->listMails());
$mailArr = $mail->listMails();
for ($i=0; $i<count($mailArr); $i++)
{
	echo ($i+1) .") ";
	echo "<b>Sender: </b>". $mailArr[$i]['sender'] ."<br />";
	echo "<b>to: </b>". $mailArr[$i]['to'] ."<br />";
	echo "<b>date: </b>". $mailArr[$i]['date'] ."<br />";
	echo "<b>size: </b>". $mailArr[$i]['size'] ."<br />";
	echo "<b>subject: </b>". $mailArr[$i]['subject'] ."<br />";
	echo "<b>body: </b>". $mailArr[$i]['body'] ."<br />";
	echo "<br />\n";
}

$mail->closeMail();
?> 
Return current item: MicroPHP Mail Checker