I'm sure you've seen this one hundreds of times!

I copied the following script, downloaded and installed the POP3Client module but it doesn't want to connect to an external POP3 server for me, for some reason. I have put in the correct pop3 server, username and password, at least the same ones that work for me and will connect Mozilla.

Any thoughts about how to find the problem and/or debug?

It runs, but I get "You have -1 messages"

I suspect the -1 means the variable has not been initialized or for some reason it will not connect to the server.

TIA

Jim

#!/usr/bin/perl

use strict;
use Mail::POP3Client;

my($pop, $num_mesg, $i);

$pop = new Mail::POP3Client( USER     => "username",
                               PASSWORD => "password",
                               HOST     => "www.host.name" );

$num_mesg = $pop->Count;             #How many messages are there?
print ("You have ".$num_mesg." new messages.\n");

for ($i = 1; $i <= $num_mesg; $i++) {
    print $pop->Head($i), "\n";            #print header for each message
}

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to