Re: [問題] 要抓取mail-header和mail-body用些模組 …
: 那是 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
討論串 (同標題文章)
Perl 近期熱門文章
PTT數位生活區 即時熱門文章