extract text body of email

J

jcharth

Hello I need to extract the text body of an email address. I tried
email::mime and email::simple but probably i dont think i am doing this
correctly.
my $old_body = $emailsimple->body;

the variable old_body here has all the attachments may be i can use
something else email::simple is probably not what i need. Thanks
 
J

J. Gleixner

Hello I need to extract the text body of an email address.

The body of the E-Mail message? I have no idea what the body of an
E-Mail address would be.
I tried
email::mime and email::simple but probably i dont think i am doing this
correctly.
my $old_body = $emailsimple->body;

Who knows if you're doing it correctly. That line looks OK, but
we have no idea what $emailsimiple is, or what $old_body is, or
what you want to get out of your E-Mail.
the variable old_body here has all the attachments may be i can use
something else email::simple is probably not what i need. Thanks

First, you need a few more periods. :)

It's Email::Simple.

Post a short example.


Show what's in $old_body.

use Data::Dumper;
print Dumper( $old_body );

Any show what you want the output to be.
 
J

jcharth

Thanks for the replies, I found the problem but it seems that many
modules are required to simply remove all the attachments, I will give
up for now.



Michele said:
Hello I need to extract the text body of an email address. I tried
email::mime and email::simple but probably i dont think i am doing this

BTW: those should be Email::MIME and Email::Simple - case does matter.
correctly.
my $old_body = $emailsimple->body;

the variable old_body here has all the attachments may be i can use
something else email::simple is probably not what i need. Thanks

Well, I have no experience with either module, but a quick peek into
E::S's docs seems to show that there should be nothing more to do than
what you tried. OTOH E::M's parts() method seems perhaps promising.
Have you tried that?


Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,152
Latest member
LorettaGur
Top