/** * __construct * * @access public * @throws Framework_Exception * @return void */ public function __construct() { $this->userID = null; parent::__construct(); $this->acceptLog(Framework::$log); $this->setDebug((bool) Framework::$site->config->debug); $this->vpopmailRobotProgram = (string) Framework::$site->config->vpopmailRobotProgram; $this->vpopmailRobotRime = (int) Framework::$site->config->vpopmailRobotTime; $this->vpopmailRobotNumber = (int) Framework::$site->config->vpopmailRobotNumber; $address = gethostbyname((string) Framework::$site->config->vpopmaildHost); $port = (string) Framework::$site->config->vpopmaildPort; try { $this->connect($address, $port); } catch (Net_Vpopmaild_FatalException $e) { throw new Framework_Exception("Error: " . $e->getMessage()); } }
<?php /* * A simple login example */ require_once 'Net/Vpopmaild.php'; $vpop = new Net_Vpopmaild(); try { // The host, port, and timeout below are the defaults and can be omitted $vpop->connect('localhost', '89', '30'); } catch (Net_Vpopmaild_FatalException $e) { echo 'Error connecting to vpopmaild: ' . $e->getMessage(); exit; } // If we get here, authenticate if (!$vpop->authenticate('*****@*****.**', 'password')) { echo "Error: login failed"; exit; } // Display user info print_r($vpop->loginUser); exit;
<?php /* * A simple login example */ require_once 'Net/Vpopmaild.php'; $vpop = new Net_Vpopmaild(); // Let's customize the host/port $vpop->address = '192.168.1.1'; $vpop->port = 589; try { $vpop->connect(); } catch (Net_Vpopmaild_Exception $e) { echo 'Error connecting to vpopmaild: ' . $e->getMessage(); exit; } // If we get here, authenticate if (!$vpop->authenticate('*****@*****.**', 'password')) { echo "Error: login failed"; exit; } // Display user info print_r($vpop->loginUser); exit;