|
|
Subject:
Perl / MIME
Category: Computers > Programming Asked by: cgersch-ga List Price: $15.00 |
Posted:
21 May 2004 13:32 PDT
Expires: 20 Jun 2004 13:32 PDT Question ID: 350084 |
I need to parse with Perl (module: MIME::Parser) an MIME encoded E-Mail message (saved in a variable). How can I extract the plaintext only and save it in a variable? |
|
There is no answer at this time. |
|
Subject:
Re: Perl / MIME
From: nandigam-ga on 30 May 2004 23:21 PDT |
Hi cgersch, May be this will help you. #!/usr/local/bin/perl use MIME::Parser; my $parser = new MIME::Parser; $entity = $parser->parse_open("mail.msg"); $body = $entity->bodyhandle; $string = $body->as_string; print $string."\n"; The mail.msg file contained: ***************************************************************** From MAILER-DAEMON Tue Apr 20 19:46:39 2004 Date: 20 Apr 2004 19:46:39 -0400 From: Mail System Internal Data <MAILER-DAEMON@cs.odu.edu> Subject: DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA Message-ID: <1082504799@cs.odu.edu> X-IMAP: 1080886419 0000000003 Status: RO This text is part of the internal format of your mail folder, and is not a real message. It is created automatically by the mail system software. If deleted, important folder data will be lost, and it will be re-created with the data reset to initial values. *************************************************************** If this doesnt work out let me know. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |