Go Back   Velocity Reviews > Newsgroups > PERL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

PERL - Net::POP3

 
Thread Tools Search this Thread
Old 07-06-2003, 03:46 AM   #1
Default Net::POP3


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:OP3 I am not aware of, or
where did I screw up in the code?

use Net:OP3;

my $server = "pop.bloor.phub.net.cable.rogers.com";
my $pop3 = Net:OP3->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";





Lev Altshuler
  Reply With Quote
Old 07-06-2003, 01:12 PM   #2
Reto Hersiczky
 
Posts: n/a
Default Re: Net::POP3

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:OP3 I am not aware of, or
> where did I screw up in the code?
>
> use Net:OP3;
>
> my $server = "pop.bloor.phub.net.cable.rogers.com";
> my $pop3 = Net:OP3->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";




  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump