您现在的位置: 军旅同心-旅游自驾-军旅文学 >> 读书赏析 >> 学习园地 >> 电脑网络 >> 技术文章 >> 正文
pop3邮件收取一例
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005-9-10 14:34:49
nbsp;      $response=$this->GetLine();
                                if(GetType($response)!="string")
                                        return("Could not get message list response");
                                if($response==".")
                                        break;
                                $message=intval(strtok($response," "));
                                if($unique_id)
                                        $messages[$message]=strtok(" ");
                                else
                                        $messages[$message]=intval(strtok(" "));
                        }
                        return($messages);
                }
                else
                {
                        $message=intval(strtok(" "));
                        return(intval(strtok(" ")));
                }
        }

        Function RetrieveMessage($message,$headers,$body,$lines)
        {
                if($this->state!="TRANSACTION")
                        return("connection is not in TRANSACTION state");
                if($lines<0)
                {
                        $command="RETR";
                        $arguments="$message";
                }
                else
                {
                        $command="TOP";
                        $arguments="$message $lines";
                }
                if($this->PutLine("$command $arguments")==0)
                        return("Could not send the $command command");
                $response=$this->GetLine();
                if(GetType($response)!="string")
                        return("Could not get message retrieval command response");
                if(strtok($response," ")!="+OK")
                        return("Could not retrieve the message: ".strtok(" "));
                for($headers=$body=array(),$line=0;;$line++)
                {
                        $response=$this->GetLine();
                        if(GetType($response)!="string")
                                return("Could not retrieve the message");
                        switch($response)
                        {
                                case ".":
                                        return("");
                                case "":
                                        break 2;
                                default:
                                        if(substr($response,0,1)==".")
                                                $response=substr($response,1,strlen($response)-1);
                                        break;
                        }
                &nbs

上一页  [1] [2] [3] [4] [5] 下一页


更多
免责声明:作品版权归所属媒体与作者所有!!本站刊载此文不代表同意其说法或描述,仅为提供更多信息。如果您认为我们侵犯了您的版权,请告知!本站立即删除。有异议请联系我们。
文章录入:烟灰缸    责任编辑:烟灰缸 
网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
| 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 网站地图 | 版权申明 | 网站公告 | 管理登录 |