#!/usr/bin/perl
use warnings;
use strict;
use lib '../lib';

use Mail::Box::POP3;

print "Content-type: text/html\n\n";
print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=koi8-r\">
\n";

my $pop3conn = Mail::Box::POP3->new(
                server_name => 'pop.yandex.ru',
                username => 'pzotov',
                password => 'ubgth,jkf') or die "no connection";

print scalar($pop3conn->messages)." messages\n";

foreach my $msg ($pop3conn->messages)
{
    print "Size: ",$msg->size,", subject: ", $msg->subject,"<hr>";
}

$pop3conn->close();

