Re: Remove the header in multipart body?
"V.R.P. Prasad" <[email protected]> Tue, 7 Jun 2005 04:37:08 +0000 (UTC)
| Newsgroups | gmane.comp.lang.perl.modules.mail-box |
|---|---|
| Message-ID | <005801c56c48$ca530250$9b01a8c0@vrpprasad> |
No Replies?.I have to get the Body of the message which is actually coming
in parts.If I am trying to access body in parts I am getting unnecessary
headers (i.e NextPart_...........etc in the $decodebody.How can I remove the
unnecessary headers coming in the Body?
foreach my $part ($mail->parts('ALL')){
$encodebody = $partmsg->body;
$decodebody = $part_encoded_body->decoded ;
}
Please post your valuble replies.
Thanks
----Prasad
----- Original Message -----
From: "V.R.P. Prasad" <[email protected]>
To: "Mark Overmeer" <[email protected]>
Cc: "Mail-Box Mailinglist" <[email protected]>
Sent: Tuesday, June 07, 2005 10:54 PM
Subject: Re: Remove the header in multipart body?
> Hi Mark,
> Thanks for your prompt reply. But as per my requirement I can't
> skip all the Nested & Multipart messages.Depends on attachment I have to
do
> further processing. If I skip the $part->isMultipart || $part->isNested;
> messages how can I get the Body as it was coming only in @parts mentioned
> below.
> Thanks
> Prasad.
>
>
> ----- Original Message -----
> From: "Mark Overmeer" <[email protected]>
> To: "V.R.P. Prasad" <[email protected]>
> Cc: "Mail-Box Mailinglist" <[email protected]>
> Sent: Monday, June 06, 2005 10:27 AM
> Subject: Re: Remove the header in multipart body?
>
>
> > * 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
>