<?php
//by alpha.z
//05/21/2000
class myimap
{
var $username="";
var $userpwd="";
var $hostname="";
var $port=0;
var $connection=0; //是否连接
var $state="disconnected"; //连接状态
var $greeting="";
var $must_update=0;
var $instream=0;
function open()
{
if ($this->port==110)
$this->instream=imap_open("{$this->hostname/pop3:110}inbox",$this->username,$this->userpwd);
else
$this->instream=imap_open("{$this->hostname/imap:143}inbox",$this->username,$this->userpwd);
if ($this->instream)
{
echo "用户:$this->username 的信箱连接成功。<br>";
return $instream;
}
else
{
echo "用户:$this->username 的信箱连接失败。<br>";
return 0;
}
}
function close()
{
if(imap_close($this->instream))
{
echo "<hr>已经与服务器 $this->hostname 断开连接。";
return 1;
}
else
{
echo "<hr>与服务器 $this->hostname 断开连接失败。";
return 0;
}
}
function checkmailbox()
{
$mboxinfo=@imap_mailboxmsginfo($this->instream);
//$mboxinfo=ima
| 对此文章发表了评论 |
