简体   繁体   English

使用perl解析电子邮件正文

[英]Parse out the email body using perl

This is my perl code: 这是我的perl代码:

my $email = Email::Simple->new($brutEmail);
my $body = $email->body;

print $body;

And the result is 结果是

    --0016364d2ceb8da59d048be66a88 Content-Type: text/plain; charset=ISO-8859-1 Mail content email contents email contentss 
emails contentsss emmails contentsssss emmmail cccontent
    --0016364d2ceb8da59d048be66a88-- 

Or 要么

    --0016364d2ceb8da59d048be66a88 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable eMail 
content eMail content eMail content eMail content eMail content eMail content 
    --0016364d2ceb8da59d048be66a88-- 

I just want to retrieve the message body without the headers. 我只想检索没有标题的邮件正文。

eMail content eMail content eMail content eMail content eMail content eMail content

Any Idea? 任何想法? without regexp.. 没有正则表达式..

Thx 谢谢

I think Email::MIME fits the bill. 我认为Email::MIME符合要求。 It's a more advanced version of Email::Simple . 它是Email::Simple的更高级版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM