; $this->strResponse = fgets($this->resHandler, $this->intBuffSize); $this->arrResponse[] = $this->strResponse; return $this->strResponse; } //提取若干响应信息,$intReturnType是返回值类型, 1为字符串, 2为数组 function getRespMessage($intReturnType) { if (!$this->getIsConnect()) { return false; } if ($intReturnType == 1) { $strAllResponse = ''; while(!feof($this->resHandler)) { $strLineResponse = $this->getLineResponse(); if (preg_match("/^\+OK/", $strLineResponse)) { continue; } if (trim($strLineResponse)=='.') { break; } $strAllResponse .= $strLineResponse; } return $strAllResponse; } else { $arrAllResponse = array(); while(!feof($this->resHandler)) { $strLineResponse = $this->getLineResponse(); if (preg_match("/^\+OK/", $strLineResponse)) { continue; } if (trim($strLineResponse)=='.') { break; } $arrAllResponse[] = $strLineResponse; } return $arrAllResponse; } } //提取请求是否成功 function getRestIsSucceed($strRespMessage='') { if (trim($responseMessage)=='') { if ($this->strResponse=='') { $this->getLineResponse(); } $strRespMessage = $this->strResponse; } if (trim($strRespMessage)=='') { $this->setMessage('Response message is empty', 2003); return false; } if (!preg_match("/^\+OK/", $strRespMessage)) { $this->setMessage($strRespMessage, 2000); return false; } return true; } //获取是否已连接 function getIsConnect() { if (!$this->resHandler) { $this->setMessage("Nonexistent availability connection handler", 2002); return false; } return true; } //设置消息 function setMessage($strMessage, $intErrorNum) { if (trim($strMessage)=='' || $intErrorNum=='') { return false; } $this->strMessage = $strMessage; $this->intErrorNum = $intErrorNum; return true; }
//获取消息 function getMessage() { return $this->strMessage; } //获取错误号 function getErrorNum() { return $this->intErrorNum; } //获取请求信息 function getRequest() { return $this->strRequest; } //获取响应信息 function getResponse() { return $this->strResponse; } //--------------- // 邮件原子操作 //---------------
//登录邮箱 function popLogin() { if (!$this->getIsConnect()) { return false; } $this->sendCommand("USER ".$this->strEmail); $this->getLineResponse(); $bolUserRight = $this->getRestIsSucceed(); $this->sendCommand("PASS ".$this->strPasswd); $this->getLineResponse(); $bolPassRight = $this->getRestIsSucceed(); if (!$bolUserRight || !$bolPassRight) { $this->setMessage($this->strResponse, 2004); return false; } &n 上一页 [1] [2] [3] [4] 下一页
 |
频道声明:本频道的文章除部分特别声明禁止转载的专稿外,可以自由转载.但请务必注明出出处和原始作者 文章版权归本频道与文章作者所有.对于被频道转载文章的个人和网站,我们表示深深的谢意。
| 原始作者:佚名 |
录入时间:2007-1-3 3:34:28 |
| 信息来源:不详 |
投稿信箱:itqoo@126.com |
|
|
 |
|