$mylink=imap_open("{localhost:143}","zz","zz");
$mail_number = imap_num_msg($mylink);
echo "<table>";
echo "<tr><td>No</td><td>主题</td><td>发件人</td><td>日期</td><td>字节</td></tr>";
for($n = 0; $n <= $mail_number; $n++)
{
$mail_header = imap_headerinfo($mylink, $n);
$subject = $mail_header->subject;
$from = $mail_header->fromaddress;
$fromarray = $mail_header->from;
if(stristr($from,"=?gb2312"))//汉字
{
$from = substr($from,11);
$from_host = strstr($from,"<");
$from = substr($from,0,strpos($from,"?="));
$from = imap_base64($from)." ".$from_host;
}
$date = $mail_header->date;
$date = substr($date,5,11);
$size = $mail_header->Size;
echo "<tr><td>$n</td>";
echo "<td><a href=readmail.php?no=$n>$subject</a></td>";
echo "<td>$from</td>";
echo "<td>$date</td><td>$size</td></tr>";
}
echo "</table>";
$mail_number = imap_num_msg($mylink);
echo "<table>";
echo "<tr><td>No</td><td>主题</td><td>发件人</td><td>日期</td><td>字节</td></tr>";
for($n = 0; $n <= $mail_number; $n++)
{
$mail_header = imap_headerinfo($mylink, $n);
$subject = $mail_header->subject;
$from = $mail_header->fromaddress;
$fromarray = $mail_header->from;
if(stristr($from,"=?gb2312"))//汉字
{
$from = substr($from,11);
$from_host = strstr($from,"<");
$from = substr($from,0,strpos($from,"?="));
$from = imap_base64($from)." ".$from_host;
}
$date = $mail_header->date;
$date = substr($date,5,11);
$size = $mail_header->Size;
echo "<tr><td>$n</td>";
echo "<td><a href=readmail.php?no=$n>$subject</a></td>";
echo "<td>$from</td>";
echo "<td>$date</td><td>$size</td></tr>";
}
echo "</table>";
解决方案 »
- 操作文件
- 请问怎样把下面js游戏中finaltime写入数据库中?php+mysql实现?急!!!!!!
- 一个多文件上传的问题
- dreamweaver自动修改了程序代码
- 如何在双引号中(")使用二维数组的值?
- 数据库优化问题:是保持此mysql查询连接的结果,还是关闭此连接而将结果保存入二维数组进行使用好?
- 数据库问题,??????????????????????谢谢
- 请教一个问题,我的PHP版本是4.2.3,为什么不能自动获取提交的参数啊?还是要用$HTTP_POST_VARS[]才能取值!
- unset()和mysql中的query_first是什么意思啊?
- 请问怎样为一篇文章(cms)添加标签功能,能说下思路吗,谢谢,新手
- 大家做OA一般把表放在一个库还是多个库?
- 简单的查询问题(急!!!!!!)
谢谢,这40分一定给你啦,我还有个函数不知道怎么用,你可以告诉我吗?就是imap_append(),我不知道它怎么用的。我会再加20分上去的,好吗?当然,如果你没有回答,我午睡后,就结贴啦。
大概它和imap_mail()应该是差不多的只不过它是自己给自己发的,我是这么理解的。$stream = imap_open("{your.imap.host}INBOX.Drafts","username", "password");
$check = imap_check($stream);
print "Msg Count before append: ". $check->Nmsgs."\n";
imap_append($stream,"{your.imap.host}INBOX.Drafts"
,"From: [email protected]\r\n"
."To: [email protected]\r\n"
."Subject: test\r\n"
."\r\n"
."this is a test message, please ignore\r\n"
);$check = imap_check($stream);
print "Msg Count after append : ". $check->Nmsgs."\n";imap_close($stream);
http://www.mistruster.com/book/php.chm
英文版的(比较全):
http://www.mistruster.com/book/php_manual_en.zip
http://expert.csdn.net/Expert/topic/1827/1827661.xml?temp=.2373926