Re: Remove the header in multipart body?

Mark Overmeer <[email protected]> Mon, 6 Jun 2005 19:27:47 +0200
Newsgroups gmane.comp.lang.perl.modules.mail-box
Organization MARKOV Solutions
Message-ID <[email protected]>
* V.R.P. Prasad ([email protected]) [050606 19:09]:
> Hi,
>    I am accessing multipart messages using 
>            my @parts = $mail->parts('ALL');
> 
>   foreach  part(attachment) I am accessing using
>             $encodebody = $partmsg->body;
>             $decodebody = $part_encoded_body->decoded ; 
>     
> But sometimes Body of the parent mail will come as multipart so getting all the headers 

If I understand you correctly, then my answer is "of course".  There are
two special kinds of bodies: the "mulitpart" and the "nested".  You need
to leave them out...

   foreach my $part ($mail->parts('ALL'))
   {   next if $part->isMultipart || $part->isNested;
       ...
   }

-- 
               MarkOv

------------------------------------------------------------------------
drs Mark A.C.J. Overmeer                                MARKOV Solutions
       [email protected]                          [email protected]
http://Mark.Overmeer.net                   http://solutions.overmeer.net