Question on NET::POP3 
Author Message
 Question on NET::POP3

I have read the information in the Perl Cookbook along with the readme
that came with NET::POP3

I am trying to get past the very first part of the program..  below is
the code that I am using.. I have replaced $mail_server with a dummy
name to post here and the same with the username and password..

When I run this from a prompt.. I get the error message

Username password didnt work

So it gets connected to my mail server without a problem. and I have
checked the logs on the mailserver to confirm that a connection is
being started..  I have checked and rechecked the username and
password that I am using and can put them into a regular email program
and have no trouble getting the mail from the machine. So what I am
missing..

#!/usr/bin/perl

use Net::POP3;

$mail_server = "madeupname.com";
$username = "madeupusername";
$password = "madeupuserpassword";

$pop = Net::POP3->new($mail_server)
        or die "Can't open connection to $mail_server : $!\n";

$pop->login("$username", "$password")
        or die "Username password didnt work: $!\n";

Robert Saunders



Sun, 19 Aug 2001 03:00:00 GMT  
 Question on NET::POP3


Quote:
> I have read the information in the Perl Cookbook along with the readme
> that came with NET::POP3

> I am trying to get past the very first part of the program..  below is
> the code that I am using.. I have replaced $mail_server with a dummy
> name to post here and the same with the username and password..

> When I run this from a prompt.. I get the error message

> Username password didnt work

> So it gets connected to my mail server without a problem. and I have
> checked the logs on the mailserver to confirm that a connection is
> being started..  I have checked and rechecked the username and
> password that I am using and can put them into a regular email program
> and have no trouble getting the mail from the machine. So what I am
> missing..

> #!/usr/bin/perl

> use Net::POP3;

> $mail_server = "madeupname.com";
> $username = "madeupusername";
> $password = "madeupuserpassword";

> $pop = Net::POP3->new($mail_server)
>    or die "Can't open connection to $mail_server : $!\n";

> $pop->login("$username", "$password")
>    or die "Username password didnt work: $!\n";

> Robert Saunders


I use Mail::POP3Client; and it works just fine.

here's excerpt from perldoc POP3Client:
#!/usr/local/bin/perl

  use Mail::POP3Client;

  $pop = new Mail::POP3Client("me", "mypass", "pop3.do.main");
  for ($i = 1; $i <= $pop->Count; $i++) {
        foreach ($pop->Head($i)) {
                /^(From|Subject): / and print $_, "\n";
        }
        print "\n";
  }

this should get you started.

___

Dimitri Ostapenko,
3D CAD Designer/System Administrator
Fantom Technologies Inc.



Sun, 19 Aug 2001 03:00:00 GMT  
 Question on NET::POP3
Works like a charm.. thank you sir..


Quote:



>> I have read the information in the Perl Cookbook along with the readme
>> that came with NET::POP3

>> I am trying to get past the very first part of the program..  below is
>> the code that I am using.. I have replaced $mail_server with a dummy
>> name to post here and the same with the username and password..

>> When I run this from a prompt.. I get the error message

>> Username password didnt work

>> So it gets connected to my mail server without a problem. and I have
>> checked the logs on the mailserver to confirm that a connection is
>> being started..  I have checked and rechecked the username and
>> password that I am using and can put them into a regular email program
>> and have no trouble getting the mail from the machine. So what I am
>> missing..

>> #!/usr/bin/perl

>> use Net::POP3;

>> $mail_server = "madeupname.com";
>> $username = "madeupusername";
>> $password = "madeupuserpassword";

>> $pop = Net::POP3->new($mail_server)
>>        or die "Can't open connection to $mail_server : $!\n";

>> $pop->login("$username", "$password")
>>        or die "Username password didnt work: $!\n";

>> Robert Saunders

>I use Mail::POP3Client; and it works just fine.

>here's excerpt from perldoc POP3Client:
>#!/usr/local/bin/perl

>  use Mail::POP3Client;

>  $pop = new Mail::POP3Client("me", "mypass", "pop3.do.main");
>  for ($i = 1; $i <= $pop->Count; $i++) {
>        foreach ($pop->Head($i)) {
>                /^(From|Subject): / and print $_, "\n";
>        }
>        print "\n";
>  }

>this should get you started.

>___

>Dimitri Ostapenko,
>3D CAD Designer/System Administrator
>Fantom Technologies Inc.



Sun, 19 Aug 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Small '-w' Question with Net::POP3

2. NET::SSH, NET::FTP, NET::POP3 (how to detect)

3. configuring pop3 host for net::pop3

4. Net::POP3 question

5. Net::POP3 Modules question

6. Silly newbie question (Net::POP3)

7. Net::POP3 Array Question

8. Net::POP3

9. Net:POP3 From/To lines

10. Net::POP3 Module error under Perl5 for Win32

11. Net::POP3 fails to login to mailbox if its empty

12. Help with Net::Pop3

 

 
Powered by phpBB® Forum Software