ets($this->Socket, 1024);
$this->Status[ "LASTRESULT"] = substr($this->Line, 0, 1);
$this->Status[ "LASTRESULTTXT"] = substr($this->Line, 0, 1024);
if ($this->Status[ "LASTRESULT"] <> "+") return false;
return true;
}
function pop3_pass( $pass)
{
fputs($this->Socket, "PASS $passrn");
$this->Line = fgets($this->Socket, 1024);
$this->Status[ "LASTRESULT"] = substr($this->Line, 0, 1);
$this->Status[ "LASTRESULTTXT"] = substr($this->Line, 0, 1024);
if ($this->Status[ "LASTRESULT"] <> "+") return 0;
return 1;
}
function pop3_stat()
{
fputs($this->Socket, "STATrn");
$this->Line = fgets($this->Socket, 1024);
$this->Status[ "LASTRESULT"] = substr($this->Line, 0, 1);
$this->Status[ "LASTRESULTTXT"] = substr($this->Line, 0, 1024);
if ($this->Status[ "LASTRESULT"] <> "+") return 0;
if (!eregi( "+OK (.*) (.*)", $this->Line, $regs))
return 0;
return $regs;
}
function pop3_list()
{
fputs($this->Socket, "LISTrn");
$this->Line = fgets($this->Socket, 1024);
$this->Status[ "LASTRESULT"] = substr($this->Line, 0, 1);
$this->Status[ "LASTRESULTTXT"] = substr($this->Line, 0, 1024);
if ($this->Status[ "LASTRESULT"] <> "+") return 0;
$i = 0;
while (substr($this->Line = fgets($this->Socket, 1024), 0, 1) <> ".")
{
$articles[$i] = $this->Line;
$i++;
}
$articles[ "count"] = $i;
return $articles;
}
function pop3_retr($nr)
{
fputs($this->Socket, "RETR $nrrn");
$this->Line = fgets($this->Socket, 1024);
$this->Status[ "LASTRESULT"] = substr($this->Line, 0, 1);
$this->Status[ "LASTRESULTTXT"] = substr($this->Line, 0, 1024);
if ($this->Status[ "LASTRESULT"] <> "+") return 0;
while (substr($this->Line = fgets($this->Socket, 1024), 0, 1) <> ".")
{
$data[$i] = $this->Line;
$i++;
}
$data[ "count"] = $i;
return $data;
}
function pop3_dele( $nr)
{
fputs($this->Socket, "DELE $nrrn");
$this->Line = fgets($this->Socket, 1024);
$this->Status[ "LASTRESULT"] = substr($this->Line, 0, 1);
$this->Status[ "LASTRESULTTXT"] = substr($this->Line, 0, 1024);
if ($this->Status[ "LASTRESULT"] <> "+") return 0;
return 1;
}
function pop3_quit()
{
fputs($this->Socket, "QUITrn");
$this->Line = fgets($this->Socket, 1024);
$this->Status[ "LASTRESULT"] = substr($this->Line, 0, 1);
$this->Status[ "LASTRESULTTXT"] = substr($this->Line, 0, 1024);
if ($this->Status[ "LASTRESULT"] <> "+") return 0;
return 1;
}
}
class Smtp {
var $Subject; // string the email''s subject
var $FromName; // string sende