Net::POP3

L

Lev Altshuler

Hi,

I am trying to count email messages in the mailbox and read their headers.
In case that there are some messages on the POP3 server and
they haven't yet got to the Inbox, I get a number of messages.
As soon as they have been in the Inbox, I get '0E0' as a number of messages.
Does anyone know what feature of Net::pOP3 I am not aware of, or
where did I screw up in the code?

use Net::pOP3;

my $server = "pop.bloor.phub.net.cable.rogers.com";
my $pop3 = Net::pOP3->new($server, Timeout => 10, Debug =>1);
die "Couldn't log on to server" unless $pop3;

my $user = "levalt\@rogers.com";
my $password = "password";
my $num_Messages = $pop3->login($user, $password);
print "$num_Messages\n";
 
R

Reto Hersiczky

Lev,

$pop3->login( ) actually returns the number of messages in the mailbox
*or* UNDEF if the authentication should fail. '0E0' is being returned if
the login was successful but there are no messages in the inbox. The
reason for this is to assure you become always a TRUE value on a
successful login.

HTH & BR,
retoh :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top