Perl to read EMBEDDED Outlook email?

M

maylin

Hope some experts can help me on this -

If you have an Outlook email that includes an attached email, how can
you use Perl to read/parse that embedded email? I tried to use
WIN32::OLE, and I know you can get the mail body this way:
$mailbody=$folder->Items->Item($i)->Body;

Now this email also has an attached email and I need to get its mail
body. So I used following line to get the attached email:
my $attach = $folder->Items->Item($i)->Attachments();

After this line runs the $attach is that embedded email (and I can
save the $attach to a text file), but how to open it to get its email
body?

I tried following but none of them worked:

$mailbody=$attach->Body; # not working
$mailbody=$attach->Items->Item(1)->Body; # not working
$mailbody = $folder->Items->Item($i)->Attachments()->Body; # not
working

It'll be highly appreciated if somebody tells me where is wrong or
where to find some sample codes.
 
P

Peter J. Holzer

Hope some experts can help me on this -

If you have an Outlook email that includes an attached email, how can
you use Perl to read/parse that embedded email? I tried to use
WIN32::OLE, and I know you can get the mail body this way:
$mailbody=$folder->Items->Item($i)->Body;

Can you get at the complete rfc5322-conforming text of the email?
If you can, simply parse it with MIME::parser and extract the parts you
need from the MIME::Entity object it returns.

hp
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top