hello experts,
I am writing one code which detect new coming mails from
server and download it to file. I am showing you the portion
of code.
1 for($l=1;$l<=$msg_id;$l++)
2 {
3 my $MsgContent = $pop3->top($l, 20);
4 open (CHECK, ">msgtext$l.txt") || die ("sorry");
5 $pop3->get($l,*CHECK);
In the above you should test for a true/false return value to see if there is an error occurring. In the case that there is, it should be retrievable with:
$pop3->message; # (see Net::Cmd for more)
6 close (CHECK);
8 }
Where $msg_id is no. of new incoming mails for me.
$pop3 is instance of mailserver created using Net::POP3.
Now problem is that when loop will execute first time
it is creating msgtext1.txt containg mail message but
when second onwards loop will execute, its just creating empty files like msgtext2.txt, msgtext3.txt and so on.
I can not identify the problem. Can anybody plz give
me solution over this.
You should turn on the 'Debug' flag during object construction and see if the output provides any clues. You might also check the POP3 server logs to determine if any error messages are being output on that side. It appears the 'top' method is optional for the server.
Thnx in advance...
A cursory glance at the docs doesn't turn up anything immediately wrong in the snippet you provided above. Do mesgs >1 get returned if you save them directly to a variable??
http://danconia.org
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>