Location: PHPKode > scripts > Socket handler > socket-handler/socket.example.php
<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 hide@address.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>
Return current item: Socket handler