作者deh3215 ()
看板Perl
标题Re: [问题] 要抓取mail-header和mail-body用些模组 …
时间Tue Feb 10 14:36:12 2009
: 那是 MIME-Q。
: $ echo '=?Big5?B?rHmq97ezpOuseQ==?=' | piconv -f MIME-Q -t BIG5
: 一样的习惯,这种部份交给 module 去处理会比自己处理好,除非你把 RFC 看的很透。
现在有个问题,
my $msg = Mail::Box::Manager->new;
my $folder_file = "/var/spool/mail/root";
my $folder = $msg->open(folder => $folder_file) or die "can not open mail!";
for($folder->messages) {
@body = $_->body;
}
body内容会印出
--001636417901011b1c04625f3bc3
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
xxxxxxxxxx <==信件内容
接着重复以上,但信件内容多了html标签
--001636417901011b1c04625f3bc3
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<tag>xxxxxxxxxx</tag>
问题:有无模组可直接取出信件内容,不需要去管content-type,charset,content-transfer-
encoding?这样我可直接抓出想要的信件内容?
thx
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.117.168.75