![]() |
|
|
|
#1 |
|
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: where did I screw up in the code? use Net: my $server = "pop.bloor.phub.net.cable.rogers.com"; my $pop3 = Net: 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"; Lev Altshuler |
|
|
|
|
#2 |
|
Posts: 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" <> wrote in message news:64MNa.70818$ 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: > where did I screw up in the code? > > use Net: > > my $server = "pop.bloor.phub.net.cable.rogers.com"; > my $pop3 = Net: > 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"; |
|