if ($EMAIL_INC) return;
$EMAIL_INC= "defined";
define( "SmtpPort",25);
class Pop3 {
var $subject; / / Email subject
var $from_email; // Sender address
var $from_name; // Sender name
var $to_email; // Recipient address
var $to_name; / / Recipient name
var $body; // Email content
var $filename; // File name
var $socket; // Current socket
var $Line;
var $Status;
function pop3_open($server, $port)
{
$this->Socket = fsockopen($server, $port);
if ($this->Socket < ;= 0){
return false;
}
$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 false;
return true;
}
function pop3_user($user)
{
if ( $this->Socket < 0){
return false;
}
fputs($this->Socket, "USER $this->userrn");
$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 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;