Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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

by sachss (Sexton)
on Jan 25, 2017 at 19:51 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2024-03-29 01:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found