-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMailBox.class.php
More file actions
40 lines (38 loc) · 1.35 KB
/
Copy pathMailBox.class.php
File metadata and controls
40 lines (38 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
namespace ImapServer;
require_once( $_SERVER[ "DOCUMENT_ROOT" ] . "/MailHeader.class.php" );
class Mailbox{
protected $name;
protected $headerList;
protected $messageCount;
public function __construct( $connection, $name, $criteria ){
$this->name = $name;
$this->headerList = array();
$this->get( $connection, $criteria );
}
private function get( $connection, $criteria ){
$listUid = imap_search( $connection, $criteria );
if( $listUid === false ){
$this->messageCount = 0;
}
else{
$this->messageCount = count( $listUid );
foreach( $listUid as $uid ){
$header = imap_headerinfo( $connection, $uid );
if( is_object( $header ) ){
$this->headerList[] = new MailHeader( $header );
}
}
}
}
public function getHeaderList(){
return $this->headerList;
}
public function getMessageCount(){
return $this->messageCount;
}
public function isExistMessage(){
return ( $this->messageCount > 0 );
}
}
// eof