Gossamer Forum
Home : General : Perl Programming :

Parse Email

Quote Reply
Parse Email
I'm using a pop3 module for my helpdesk script and emails are fetched in the following format:

This is a multi-part message in MIME format.
------=_NextPart_000_000B_01C19779.AD7C3540
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printableThis is just a test.
------=_NextPart_000_000B_01C19779.AD7C3540
Content-Type: text/html; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =charset=3Dwindows-1252">
<META content=3D"MSHTML 6.00.2712.300" name=3DGENERATOR>
<STYLE>
</STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>
<FONT face=3DArial size=3D2>
This is just a =test.
</FONT>
</DIV>
</BODY>
</HTML>
------=_NextPart_000_000B_01C19779.AD7C3540--

Is this the standard format or is it just because Im viewing it through my browser?

I wasn't expecting html code.

Im parsing it with the following:

$body =~ s,^.*<FONT[^>]+>(.*?)</FONT>.*$,$1,si;

Is there something more reliable I can use?

Thanks.


Subject Author Views Date
Thread Parse Email Paul 4938 Jan 7, 2002, 6:01 AM
Post Re: [RedRum] Parse Email
Paul 4814 Jan 7, 2002, 7:06 AM
Post Re: [RedRum] Parse Email
Paul 4849 Jan 7, 2002, 7:22 AM
Thread Re: [RedRum] Parse Email
Michael_Bray 4837 Jan 7, 2002, 8:19 AM
Post Re: [Michael_Bray] Parse Email
Paul 4797 Jan 7, 2002, 8:33 AM
Thread Re: [Michael_Bray] Parse Email
Paul 4806 Jan 7, 2002, 9:14 AM
Thread Re: [RedRum] Parse Email
Wil 4797 Jan 7, 2002, 9:17 AM
Thread Re: [Wil] Parse Email
Paul 4823 Jan 7, 2002, 9:26 AM
Thread Re: [RedRum] Parse Email
Wil 4828 Jan 7, 2002, 9:36 AM
Thread Re: [Wil] Parse Email
Paul 4826 Jan 7, 2002, 10:48 AM
Post Re: [RedRum] Parse Email
Wil 4765 Jan 8, 2002, 1:25 AM