in reply to Re^3: MIME::Tools to save attachment properly
in thread MIME::Tools to save attachment properly
I checked the $entity data through Dump::Data, and looks like an actual email.
I did find that
will outputs all the parts.my $bh = $part->bodyhandle; print "MIME Type: $type\n";
But
the $bh-print, seems to 'overwrite' the attachments making them zero-length.my $bh = $part->bodyhandle; print "MIME Type: $type\n"; if (defined $bh) { open(my $OUTFILE, ">", $bh->path) or die $!; binmode($OUTFILE); $bh->print(\$OUTFILE); close($OUTFILE); } #End IF $bh defined
So I removed that part and my code works. I do need to look at MIME::Parser::Filer more to clean up my code.
I do appreciate everyone's input and this wonderful site.
|
---|
In Section
Seekers of Perl Wisdom