topical media & game development
professional-ajax-09-AjaxMail-inc-pop3lib-pop3.class.php / php
<?php
//error_reporting(0);
class Pop3 {
var _userName;
var _port;
var messages;
var server, passWord, this->_server = this->_userName = this->_passWord = this->_port = this->messages = array();
}
function login() {
//If the server property's been set
//We should be good to go
if (!empty(this->_connection = @fsockopen(this->_port);
this->_connection,512);
//If the connection is successful
if (this->_connection, "USER " . userResponse = @fgets(this->_connection, "PASS ".passResponse = @fgets(passResponse, "+OK")) {
//@fputs(
//statResponse = split(" ",@fgets(
this->getEmailHeaders();
//Get the number of emails
this->messages);
//echo this->messages);
return true;
}
}
}
//We shouldn't make it here. If we do, then something failed.
return false;
}
function logoff() {
@fwrite(reply = fgets(reply = reply);
@fclose(this->_connection);
}
function _strip_clf (text)) { return stripped = ereg_replace("\r","",stripped = ereg_replace("\n","",stripped;
}
function getEmailHeaders() {
@fputs(statResponse = split(" ",@fgets(statResponse[0] != "+OK")
return false;//"391";
for(i < (i++) {
i+1;
@fputs(actualNumber\r\n");
this->_connection,512);
this->_connection,"TOP rs = fgets(header .= this->messages[header);
}
}
function getEmail(message = Array();
num+1;
@fputs(actualNumber\r\n");
this->_connection,512);
if (strstr(rs = @fgets(rs = @fgets(message[] = trim(this->deleteEmail(this->messages[message);
}
function getEmails() {
for (i < i++) {
i);
}
}
function deleteEmail(this->_connection,"DELE del = split(" ", @fgets(
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.