コード例 #1
0
ファイル: inbox.inc.php プロジェクト: cjbayliss/alloc
 public static function get_list()
 {
     // Get list of emails
     $info = inbox::get_mail_info();
     $email_receive = new email_receive($info);
     $email_receive->open_mailbox($info["folder"], OP_HALFOPEN | OP_READONLY);
     $email_receive->check_mail();
     $new_nums = $email_receive->get_new_email_msg_uids();
     $msg_nums = $email_receive->get_all_email_msg_uids();
     if ($msg_nums) {
         foreach ($msg_nums as $num) {
             $row = array();
             $email_receive->set_msg($num);
             $email_receive->get_msg_header();
             $row["from"] = $email_receive->get_printable_from_address();
             in_array($num, (array) $new_nums) and $row["new"] = true;
             $row["id"] = $num;
             $row["date"] = $email_receive->mail_headers["date"];
             $row["subject"] = $email_receive->mail_headers["subject"];
             $rows[] = $row;
         }
     }
     $email_receive->close();
     return $rows;
 }