Beispiel #1
0
<?php

error_reporting(E_ERROR | E_WARNING | E_PARSE);
require "MailImap.class.php";
$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();
$mail_structure = $imap->get_structure($msg);
$emailVolue = $imap->proc_structure($mail_structure, "", $msg);
echo "<pre>";
echo "<hr>" . $emailVolue;
echo "</pre>";
echo "<hr>";
if ($imap->num_of_attach > 0) {
    $imap->print_attaches();
}
@$imap->close();
Beispiel #2
0
<?php

//测试imap接收邮件
//by indraw
//2004/11/24
error_reporting(E_ERROR | E_WARNING | E_PARSE);
require "MailImap.class.php";
//-----------------------------------------------------------------------------
$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 . " ";