include("alt-bot-lib-pop3.php");
include("alt-bot-lib-parse.php");
define("SERVER", YOUR_MAIL_SERVER); // Name of your POP3 mail server
define("USER", YOUR_EMAIL_ADDRESS); // Your POP3 email address
define("PASS", YOUR_PASSWORD); // Your POP3 password
// Connect to POP3 server
$connection_array = POP3_connect(SERVER, USER, PASS);
$POP3_connection = $connection_array['handle'];
$list_array = POP3_list($POP3_connection);
$message = POP3_retr($POP3_connection, 1);
$ret_path = return_between($message, "Return-Path: ", "\n", EXCL );
$deliver_to = return_between($message, "Delivered-To: ", "\n", EXCL );
$date = return_between($message, "Date: ", "\n", EXCL );
$from = return_between($message, "From: ", "\n", EXCL );
$subject = return_between($message, "Subject: ", "\n", EXCL );
$content_type = return_between($message, "Content-Type: ", "\n", EXCL);
$boundary = get_attribute($content_type, "boundary");
$raw_msg = return_between($message, "--".$boundary, "--".$boundary, EXCL );
$clean_msg = return_between($raw_msg, chr(13).chr(10).chr(13).chr(10), chr(13).chr(10).chr(13).chr(10), EXCL );
echo "ret_path = $ret_path";
echo "deliver_to = $deliver_to";
echo "date = $date";
echo "subject = $subject";
echo "content_type = $content_type ";
echo "boundary = $boundary ";
echo "clean_msg = $clean_msg";
?>