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] 下一页