分类:
2005-12-28 14:29:57
//header("Content-type:text/html;charset:utf8");
$username = "*******";
$password = "*******";
$mbox = imap_open("{}INBOX", "$username", "$password");
$num = imap_num_msg($mbox);
if (!isset($id)) {
echo "
";
//print_r(imap_mime_header_decode($value->subject));
}
} else {
//show mail content
$body = imap_body($mbox, $id);
$msgobj = imap_fetch_overview($mbox, "$id");
$fromobj = imap_mime_header_decode($msgobj[0]->from);
//$body = imap_mime_header_decode($body);
echo "第 $id 条消息的内容:
";
echo "发件人:".$fromobj[0]->text."
";
echo "接收时间:".$msgobj[0]->date."
";
echo imap_qprint($body)."
";
}
imap_close($mbox);
?>