需要 perl 5。6 并且要安装 模块 Mail-POP3Client
生成的file.txt 里就是邮件的东西~
如有什么问题,希望跟贴
#!usr/bin/perl
use Mail::POP3Client;
if (@ARGV<3) {
print "\n输入的参数不够\n\n"."使用列子 $0 name pass pop3地址 \n\n";
exit
}
$name=$ARGV[0];
$pass=$ARGV[1];
$pop3=$ARGV[2];
$mail = new Mail::POP3Client("$name","$pass","$pop3");
if ($mail->Count) {
print "you have ",$mail->Count, " new message(s).\n";
print "Storing message(s) to disk.\n";
open FILEHANDLE, ">file.txt";
for ($loop_index=1;$loop_index<=$mail->Count; $loop_index++){
print FILEHANDLE $mail->HeadAndBody($loop_index);
}
#print FILEHANDLE $mail->HeadAndBody($loop_index);
close FILEHANDL;
} |