sp; } if (!$intMailId = intval($intMailId)) { $this->setMessage('Mail message id invalid', 1005); return false; } $this->sendCommand("RETR ". $intMailId); $this->getLineResponse(); if (!$this->getRestIsSucceed()) { return false; } return $this->getRespMessage($intReturnType); } //获取某邮件前指定行, $intReturnType 返回值类型,1是字符串,2是数组 function getMailTopMessage($intMailId, $intTopLines=10, $intReturnType=1) { if (!$this->getIsConnect() && $this->bolIsLogin) { return false; } if (!$intMailId=intval($intMailId) || !$intTopLines=int($intTopLines)) { $this->setMessage('Mail message id or Top lines number invalid', 1005); return false; } $this->sendCommand("TOP ". $intMailId ." ". $intTopLines); $this->getLineResponse(); if (!$this->getRestIsSucceed()) { return false; } return $this->getRespMessage($intReturnType); } //删除邮件 function delMail($intMailId) { if (!$this->getIsConnect() && $this->bolIsLogin) { return false; } if (!$intMailId=intval($intMailId)) { $this->setMessage('Mail message id invalid', 1005); return false; } $this->sendCommand("DELE ".$intMailId); $this->getLineResponse(); if (!$this->getRestIsSucceed()) { return false; } return true; } //重置被删除得邮件标记为未删除 function resetDeleMail() { if (!$this->getIsConnect() && $this->bolIsLogin) { return false; } $this->sendCommand("RSET"); $this->getLineResponse(); if (!$this->getRestIsSucceed()) { return false; } return true; } //--------------- // 调试操作 //--------------- //输出对象信息 function printObject() { print_r($this); exit; } //输出错误信息 function printError() { echo "[Error Msg] : $strMessage <br>\n"; echo "[Error Num] : $intErrorNum <br>\n"; exit; } //输出主机信息 function printHost() { echo "[Host] : $this->strHost <br>\n"; echo "[Port] : $this->intPort <br>\n"; echo "[Email] : $this->strEmail <br>\n"; echo "[Passwd] : ******** <br>\n"; exit; } //输出连接信息 function printConnect() { echo "[Connect] : $this->resHandler <br>\n"; echo "[Request] : $this->strRequest <br>\n"; echo "[Response] : $this->strResponse <br>\n"; exit; } } ?> <? //测试代码 //例如:$o = SocketPOP3Client('邮箱地址', '密码', 'POP3服务器', 'POP3端口')
/* set_time_limit(0); $o = new SocketPOPClient('abc@126.com', '123456', 'pop.126.com', '110'); $o->popLogin(); print_r($o->getMailBaseList()); print_r($o->getMailSum(1)); print_r($o->getMailTopMessage(2, 2, 2)); $o->popLogout(); $o->closeHost(); $o->printObject(); */ ?> Linux联盟收集整上一页 [1] [2] [3] [4]
 |
频道声明:本频道的文章除部分特别声明禁止转载的专稿外,可以自由转载.但请务必注明出出处和原始作者 文章版权归本频道与文章作者所有.对于被频道转载文章的个人和网站,我们表示深深的谢意。
| 原始作者:佚名 |
录入时间:2007-1-3 3:34:28 |
| 信息来源:不详 |
投稿信箱:itqoo@126.com |
|
|
 |
|