Net::POP3

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lev Altshuler

    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::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.roge rs.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";



  • Reto Hersiczky

    #2
    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" <levalt@rogers. com> wrote in message
    news:64MNa.7081 8$x4o.46663@new s04.bloor.is.ne t.cable.rogers. com...[color=blue]
    > 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[/color]
    messages.[color=blue]
    > 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.roge rs.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";[/color]



    Comment

    Working...