----- Original Message ----- From: "John W. Krahn" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 18, 2001 6:42 PM Subject: Re: Should I use Perl?
> Raymond Lam wrote: > > > > hi there, i've just started reading the book Learning Perl and > > I'm amazed what perl can do. > > > > Currently, I'm trying to find out a way to automatically save > > email messages (from MS Exchange / Pop3) to text files in a > > directory. > > > > I am planning to write something in VB but would like to try > > perl. Could someone please tell me whether this can be done in > > perl so I don't waste time following a dead end. > > > #!/usr/bin/perl -w > use strict; > use Net::POP3; > > my $user_name = 'yourname'; > my $user_pw = 'yourpassword'; > my $pop_host = 'pop.somehost.com'; > my $mail_file = '/home/yourname/mail'; > > my $pop = Net::POP3->new( $pop_host ) or die "Cannot connect to $pop_host\n"; > open my $mail, '>>', $mail_file or die "Cannot open $mail_file: $!"; > > $pop->login( $user_name, $user_pw ) == 0 and die "No messages at $pop_host\n"; > $pop->get( $_, $mail ) for keys %{$pop->list()}; > > __END__ > > > > John > -- A quick question here. Do you place the actual username and password in the script, or does it prompt you for them when run? As an example, I have an account with username of wayneleake, password of xxxxxxxx, at mail.mynetname.net (or pop.mynetname.net). I have not tried running any of this code just yet. Still getting other things set up, and running web server plus Telnet BBS only, at this time. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]