<pre><?php
/** * This is an example of how to connect to your local email server. * The variables set in the class should be adjusted to your own environment */
include("socket.class.php");
$socket = Socket::singleton();
$socket->connect(); // S: +OK Hello there.
$socket->sendCmd("USER email@server.com"); // (email login) echo $socket->getResponse(); // S: +OK Password required.
$socket->sendCmd("PASS superSecretPassWoRd"); // (email password) echo $socket->getResponse(); // S: +OK logged in.
$socket->sendCmd("STAT"); echo $socket->getResponse(); // S: +OK 0 0
$socket->sendCmd("QUIT"); echo $socket->getResponse(); // S: +OK Bye-bye.
?></pre>
|