[Pdx-pm] parsing a MIME message

Tech Dude techdude at dpo.org
Wed Jan 4 17:44:30 PST 2006


I need to parse an email message which may be plain text or MIME  to  
get the header info and the text/plain content.  I'm trying to use  
MIME::Parser to do this but I'm confused about the objects I end up  
with,
and am hoping someone can get me over the hump.

$mime_object = MIME::parse ->new();
$entity= $mime_object->parse(\*FH); #parse the mail message

Now I'm stuck.

  I'm supposed to be able to get a MIME::Header and MIME::Body out of  
the
$entity, but I'm lost in the syntax.  Particularly since I might see  
multiple
entities (I assume multipart/alternative or an attached vcf file  
produces multiple entities??)
I want to end up with $from, $subject, and  $body variables.

--
   John Springer
   Tech Dude
   Democratic Party of Oregon
   (503)224-8200 x235





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/pdx-pm-list/attachments/20060105/8138cf1b/attachment.html


More information about the Pdx-pm-list mailing list