Net::POP3

Discussion in 'Perl' started by Lev Altshuler, Jul 6, 2003.

  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::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";
     
    Lev Altshuler, Jul 6, 2003
    #1
    1. Advertising

  2. 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$...
    > 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";
     
    Reto Hersiczky, Jul 6, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eric McDaniel
    Replies:
    0
    Views:
    473
    Eric McDaniel
    Sep 22, 2003
  2. Stephane Wirtel

    class to read an email from net/pop3 ?

    Stephane Wirtel, Oct 16, 2005, in forum: Ruby
    Replies:
    5
    Views:
    149
    Lyndon Samson
    Oct 18, 2005
  3. Mike Ho

    Net::POP3 and Firewall

    Mike Ho, Oct 2, 2007, in forum: Ruby
    Replies:
    3
    Views:
    122
    Poornima Dhanasekar
    Feb 20, 2009
  4. Lev Altshuler

    Net::POP3

    Lev Altshuler, Jul 6, 2003, in forum: Perl Misc
    Replies:
    8
    Views:
    136
    Tassilo v. Parseval
    Jul 7, 2003
  5. Ted Byers
    Replies:
    0
    Views:
    271
    Ted Byers
    Mar 20, 2009
Loading...

Share This Page