pankaj_it09 has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,

The below code outputs the emails in .txt and .html format.
Sometimes the same email is output in both the formats.
How to output in .txt format only ?
my $data = $imap->get_rfc822_body($msg); ### Create a new parser object: my $parser = new MIME::Parser; ### Tell it where to put things: $parser->output_under("I:/test"); ### Parse an in-core MIME message: my $entity = $parser->parse_data($data);

Replies are listed 'Best First'.
Re: How to make MIME::Parser store emails in .txt files
by wjw (Priest) on May 12, 2014 at 03:28 UTC
    Take a look at the last post on Extracting TEXT from email...actually, the whole node is sort of interesting. Goes a long way back, but you may find what you are looking for there at the end...

    Hope that is helpful...

    Update:

    Actaully, reading through Email:MIME it looks like you could do something with debug_structure and/or body_str. I have no experience with this, but it looks promising.

    ...the majority is always wrong, and always the last to know about it...
    Insanity: Doing the same thing over and over again and expecting different results...