Perl to read EMBEDDED Outlook email?

Discussion in 'Perl Misc' started by maylin, Oct 29, 2009.

  1. maylin

    maylin Guest

    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.
     
    maylin, Oct 29, 2009
    #1
    1. Advertising

  2. On 2009-10-29 20:41, maylin <> wrote:
    > 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
     
    Peter J. Holzer, Oct 31, 2009
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris
    Replies:
    4
    Views:
    9,404
    Denis_IBM
    Dec 18, 2010
  2. Kevin B. Pease
    Replies:
    1
    Views:
    389
    A. Sinan Unur
    Nov 19, 2004
  3. Replies:
    2
    Views:
    459
    Ben Morrow
    Aug 14, 2006
  4. Jack
    Replies:
    5
    Views:
    454
  5. heycooldude
    Replies:
    0
    Views:
    281
    heycooldude
    Mar 26, 2014
Loading...

Share This Page