in reply to Re: Using MIME::Tools to save attachments
in thread Using MIME::Tools to save attachments
The message is stored in an array and is obtained using the following code. The array is then fed into the parser entity parse_data():X-POP3-Rcpt: hidden@hidden.org Received: from hidden (hidden [111.111.111.111]) by hidden.org (8.10.2/8.10.2) with ESMTP id g441dFH07987; Fri, 3 May 2002 21:39:15 -0400 From: "Hidden" <hidden@hidden.org> To: <hidden@hidden.org> Cc: <hidden@hidden.org> Subject: Hidden Date: Fri, 3 May 2002 20:52:30 -0500 Message-ID: <000801c1f30e$5aaccb90$0c0210ac@hidden.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0009_01C1F2E4.71D6C390" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 This is a multi-part message in MIME format. ------=_NextPart_000_0009_01C1F2E4.71D6C390 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit # message here ------=_NextPart_000_0009_01C1F2E4.71D6C390 Content-Type: application/msword; name="File.DOC" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="File.DOC" # encoded datafile here ------=_NextPart_000_0009_01C1F2E4.71D6C390--
I then try and do anything with that entity and I get nothing. The code creates a .txt file in the run directory with a size of 0.use Mail::POP3Client; use MIME::Parser; $pop = new Mail::POP3Client( USER => "hidden", PASSWORD=> "hidden", HOST => "hidden" ); @message = ($pop->Head(1),"\n",$pop->Body(1)); my $parser = new MIME::Parser; $entity = $parser->parse_data(\@message);
|
|---|