当前位置:Gxlcms > PHP教程 > 使用PHP的Socket写的POP3类(二)_PHP教程

使用PHP的Socket写的POP3类(二)_PHP教程

时间:2021-07-01 10:21:17 帮助过:19人阅读

//退出登录
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;
}

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/631952.htmlTechArticle//退出登录 function popLogout() { if (!$this-getIsConnect() $this-bolIsLogin) { return false; } $this-sendCommand(QUIT); $this-getLineResponse(); if (!$this-getRestIsSucceed())...

人气教程排行