Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^4: MIME::Tools to save attachment properly

by sachss (Sexton)
on Jan 25, 2017 at 19:51 UTC ( #1180329=note: print w/replies, xml ) Need Help??


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
my $bh = $part->bodyhandle; print "MIME Type: $type\n";
will outputs all the parts.

But

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
the $bh-print, seems to 'overwrite' the attachments making them zero-length.

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1180329]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2022-07-01 13:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (98 votes). Check out past polls.

    Notices?