<?php
require '../Imap.php';
$imap=new Imap(array(
'host'=>'imap.gmail.com',
'username'=>'xxx@gmail.com',
'password'=>'xxx',
'port'=>993,
'ssl'=>true,
));
echo "<pre>".print_r($imap->info,true)."</pre>";
echo "<br/><br/>";
$messages=$imap->sort('FROM','ASC')->get();
echo "<pre>".print_r($messages,true)."</pre>";
echo "<br/><br/>";
foreach($messages as $message){
echo $message->subject.'<br/>';
}
echo "<br/><br/>";
foreach($messages as $message){
echo $message->messageNumber.' - '.($message->hasAttachments()?'Attachments exist':'No Attachments')."<br/>";
}
echo "<br/><br/>";
echo $messages[1]->hasPlain()?$messages[1]->plain:$messages[1]->html;
|