By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,705 Members | 2,017 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,705 IT Pros & Developers. It's quick & easy.

Net::POP3

P: n/a
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";

Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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 :)
--

"Lev Altshuler" <le****@rogers.com> wrote in message
news:64*******************@news04.bloor.is.net.cab le.rogers.com...
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";


Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.