Hello, I am having this strange issue where using MIME:Parser (my version is activestate 5.8.8), some mime emails containing an image are decoded perfectly, BUT some others are not !

Any help WOULD BE GREATLY APPRECIATED !!!

* Here the problematic email: www.biospring.com/email

* Here is the problematic image output, both what it should be, and what MIME::Parser does to the image: www.biospring.com/email/emailimages.html

* Here is the code (just want to extract the email text body and any images):

sub parse { use MIME::Parser; my $dir = "c:\\tmp\\parsedemails"; if (not -d $dir) { mkdir $dir or die "Can't create directory $dir: $!\n"; } ### Create a new parser object: my $parser = new MIME::Parser; ### Tell it where to put things: $parser->output_under($dir); ### Open the file: open my $fh, '<', $fileopen or die "Can't read $filopen: $!\n"; ### Parse an input filehandle: my $entity = $parser->parse($fh); # $entity->dump_skeleton; $path = "c:\\tmp\\parsedemails"; opendir(DIR, $path); @lines = readdir(DIR); closedir(DIR); ### the last directory name, is the name of the newly most recently cr +eated directory by Mail::Parser $directory = $lines[$#lines]; Print "DIR $directory END "; $pathdir = $path."\\".$directory; opendir(DIR, $pathdir) or die "can't opendir $pathdir: $!"; while (defined($file = readdir(DIR))) { push @files, $file; # Print " FILE $file END"."\n"; } closedir(DIR); } # end sub

In reply to MIME: Parser image decode sometimes doesnt work by gmarstead

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.