Beispiel #1
0
//-----------------------------------------------------------------------------
$imap = new MailImap();
$imap->hostname = "mail.dns.com.cn";
$imap->port = 143;
$imap->username = "******";
$imap->userpwd = "105080";
/*
$imap=new MailImap;
$imap->hostname="pop.163.com";
$imap->port=110;
$imap->username="******";
$imap->userpwd="iloveyou";
*/
//-----------------------------------------------------------------------------
$imap->open();
$imap->get_mailbox();
if ($page == "") {
    $page = 0;
}
$getMailInfo = $imap->check_mailinfo(10, $page);
if ($getMailInfo[info]->Nmsgs > 0) {
    //echo "您邮箱:".$mboxinfo->Mailbox."<br>";
    echo $imap->username . "@" . $imap->hostname . "的收件箱里共有邮件数:" . $getMailInfo[info]->Nmsgs . "<br>\n";
    echo "未读邮件数:" . $getMailInfo[info]->Unread . " ";
    echo "新邮件数:" . $getMailInfo[info]->Recent . " ";
    echo "总共占用空间:";
    echo $getMailInfo[info]->Size > 1024 ? sprintf("%.0f kb", $getMailInfo[info]->Size / 1024) : $getMailInfo[info]->Size;
    echo "字节<br>\n";
    $last_page = ceil($getMailInfo[info]->Nmsgs / 10);
    $cur_page = $page + 1;
    echo "第" . $cur_page . "页,共" . $last_page . "页。\n";