Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl to read embedded email ??

Status
Not open for further replies.

ylacton

Technical User
Joined
Oct 16, 2009
Messages
1
Location
US
Hi

If you have an email that includes an attached email, how can you use Perl to [highlight]read/parse that embedded email[/highlight]?

I tried to use WIN32::OLE, and I know you can get the mail body this way:

$mailbody=$folder->Items->Item($i)->Body;

If this email has attached email and I'm only interested to get the mail body of that embedded email, I can use 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

I got stuck here. It'll be highly appreciated if somebody tells me where is wrong or where to find some sample codes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top