一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

使用PHP的Socket写的POP3类(二)

时间:2008-03-10 编辑:简简单单 来源:一聚教程网


//退出登录
function popLogout()
{
if (!$this->getIsConnect() && $this->bolIsLogin)
{
return false;
}
$this->sendCommand("QUIT");
$this->getLineResponse();
if (!$this->getRestIsSucceed())
{
return false;
}
return true;
}

//获取是否在线
function getIsOnline()
{
if (!$this->getIsConnect() && $this->bolIsLogin)
{
return false;
}
$this->sendCommand("NOOP");
$this->getLineResponse();
if (!$this->getRestIsSucceed())
{
return false;
}
return true;
}

//获取邮件数量和字节数(返回数组)
function getMailSum($intReturnType=2)
{
if (!$this->getIsConnect() && $this->bolIsLogin)
{
return false;
}
$this->sendCommand("STAT");
$strLineResponse = $this->getLineResponse();
if (!$this->getRestIsSucceed())
{
return false;
}
if ($intReturnType==1)
{
return $this->strResponse;
}
else
{
$arrResponse = explode(" ", $this->strResponse);
if (!is_array($arrResponse) || count($arrResponse)<=0)
{
$this->setMessage('STAT command response message is error', 2006);
return false;
}
return array($arrResponse[1], $arrResponse[2]);
}
}

//获取指定邮件得Session Id
function getMailSessId($intMailId, $intReturnType=2)
{
if (!$this->getIsConnect() && $this->bolIsLogin)
{
return false;
}

热门栏目