<?php
//
// +--------------------------------------------------------------------------+
// | |
// | XS PHP Library Generic Classes Library |
// | |
// | Copyright (c) 2001-2002 XSPHPLib Group. |
// | |
// +--------------------------------------------------------------------------+
// | |
// | Distributed under the terms of the GNU Lesser General Public License as |
// | published by the Free Software Foundation version 2.1 |
// | See the GNU Lesser General Public License for more details. You should |
// | have received a copy of the GNU Lesser General Public License along with |
// | this package; if not, write to the Free Software Foundation, Inc., |
// | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
// | |
// +--------------------------------------------------------------------------+
// | |
// | Authors: Robert Bala <hide@address.com> |
// | |
// +--------------------------------------------------------------------------+
//
// $Id: mreader.php,v 1.2 2002/11/28 09:51:38 rbala Exp $
include_once('../inc/object.inc.php');
include_once('../inc/mime.inc.php');
include_once('../inc/mail.inc.php');
include_once('../inc/socket.inc.php');
include_once('../inc/pop3.inc.php');
include_once('../inc/mailreader.inc.php');
// POP server.
$host = 'localhost';
// Account username.
$user = 'username';
// Account password.
$pass = 'password';
$reader = new MailReader($host, $user, $pass);
$result = $reader->open();
if (object_isError($result)) {
die($result->getMessage());
}
$result = $reader->read(1);
if (!object_isError($result)) {
echo "<pre>\r\n";
echo $result->mailHeaders();
echo "\r\n";
echo $result->mailMessage();
echo "</pre>\r\n";
} else {
echo $result->getMessage();
}
$reader->close();
?>