phpbar.de logo

Mailinglisten-Archive

[php] POP3 !

[php] POP3 !

Thomas Schneider Antivivisektion_(at)_t-online.de
Mon, 06 Sep 1999 12:14:18 +0200


Swen Anklam wrote:
> [POP3 mit PHP]

POP3 1.0 - An RFC 1939 compliant PHP wrapper to the POP3 protocol
http://www.thewebmasters.net/php/ (z.Zt. down)

SYNOPSIS aus dem man:

    include("class.POP3.php3");

    $pop3 = new POP3();

    if(!$pop3->connect("mail.yourserver.com",60))
    {
        echo "Ooops $pop3->ERROR <BR>\n";
            exit;
    }

    $login = 'cdi';
    $pass = 'secret';
    $Count = $pop3->login($login,$pass);
    if( (!$Count) or ($Count == -1) )
    {
        echo "<H1>Login Failed: $pop3->ERROR</H1>\n";
        exit;
    }

    // ONLY USE THIS IF YOUR PHP VERSION SUPPORTS IT!
    register_shutdown_function($pop3->quit());

    if ($Count < 1)
    {
        echo "Login OK: Inbox EMPTY<BR>\n";
    } else {
        echo "Login OK: Inbox contains [$Count] messages<BR>\n";
    }
    $MsgOne = $pop3->get(1);
    if( (!$MsgOne) or (gettype($MsgOne) != "array") )
    {
        echo "oops, $pop3->ERROR<BR>\n";
        exit;
    }
    while ( list ( $lineNum,$line ) = each ($MsgOne) )
    {
        echo "$line <BR>\n";
    }
    if(!$pop3->delete(1))
    {
        echo "oops $pop3->ERROR <BR>\n";
        $pop3->reset();
        exit;
    } else {
        echo "Message 1 Deleted <BR>\n";
    }
    exit;


DESCRIPTION 

class.POP3.php3 is a wrapper to the POP3 protocol, as 
specified by RFC 1939. All mandatory POP3 commands are 
available, as are a few optional POP3 commands. Using 
this class you can construct your own POP3 based web 
mail program, check for new mail from the web, or even 
use POP3 to authenticate secured areas of your web site. 


Herzliche Grüße,
Thomas Schneider


php::bar PHP Wiki   -   Listenarchive