[perl]代码库
#!/usr/bin/perl
use strict;
use Net::POP3;
use Data::Dumper;
my $user = "user";
my $pass = shift or die "Usage : $0 passwd\n";
my $host = "pop3.web.com";
#pop3 address
my $p = Net::POP3->new ( $host ) or die "Can't connect $host!\n";
$p->login ( $user, $pass ) or die "user or passwd error!\n";
my $title = $p->list or die "No mail for $user\n";
foreach my $h ( keys %$title )
{
my $msg = $p->get ( $h );
print @$msg;
}
$p->quit;
exit 0;
telnet pop3.web.com 110 也可以直接连到pop3 server上,然后通过pop3命令与邮件服务器交互,
#简单的命令有:
QUOTE:
USER name
PASS string
STAT
LIST [n]
RETR msg
DELE msg
NOOP
RSET
QUIT
#这样,也就可以利用Net::Telnet来做一个收信件的简单程序。
by: 发表于:2017-09-11 11:52:05 顶(0) | 踩(0) 回复
??
回复评论