Location: PHPKode > scripts > Socket handler > socket-handler/socket.example.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


$socket = Socket::singleton();

// 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.

echo $socket->getResponse(); // S: +OK 0 0

echo $socket->getResponse(); // S: +OK Bye-bye.

Return current item: Socket handler