gmarstead has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: MIME: Parser image decode sometimes doesnt work
by oko1 (Deacon) on Oct 11, 2010 at 05:15 UTC | |
by gmarstead (Initiate) on Oct 11, 2010 at 16:42 UTC | |
|
Re: MIME: Parser image decode sometimes doesnt work
by Khen1950fx (Canon) on Oct 11, 2010 at 00:13 UTC |