topical media & game development
professional-sql-03-lib-POP3Client.php / php
<?php
class POP3Client
{
private response;
// initialize a new POP3Client object
public function __construct()
{
this->response = '';
}
// return true if +OK response received
private function isOk()
{
return substr(server, this->server = @fsockopen('tcp://' .
{
return false;
}
this->response = trim(fgets(this->isOk())
{
fclose(username)
{
fwrite(username . "\r\n");
this->server, 512));
return password)
{
fwrite(password . "\r\n");
this->server, 512));
return this->server, 'NOOP' . "\r\n");
this->server, 512));
return this->server, 'STAT' . "\r\n");
this->server, 512));
return args = func_get_args();
fwrite(args[0] . "\r\n");
this->server, 512));
if (!message = explode(' ', message); // drop +OK
message[1]); // trim trailing \r\n
return this->server, 'LIST' . "\r\n");
this->server, 512));
if (!messages = array();
while ((this->server, 512)) != '.' . "\r\n")
{
list(size) = explode(' ', messages[size);
}
return id)
{
fwrite(id . "\r\n");
this->server, 512));
if (!message = '';
while ((this->server, 512)) != '.' . "\r\n")
{
line;
}
return id)
{
fwrite(id . "\r\n");
this->server, 512));
return this->server, 'RSET' . "\r\n");
this->server, 512));
return this->server, 'QUIT' . "\r\n");
this->server, 512));
fclose(this->isOk();
}
}
?>
(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.