Hi there,

I would like to ask some suggestions on my following problem:

I am making a small tool which allows you to store incomming mail in a database table.
This mail is then scanned on keywords etc etc and with the help of some status bits the
is given. Via a webpage interface, people can then answer these emails...

I started out by creating a extra Mailbox to which I route all the incoming mail. With 
help of
a Cron-Job which runs a PHP class made by Manual Lemos to retrieve POP mail I retrieve 
mail and
insert it into a database table (MySQL)

So far so good! Only problem which I have is that some (=most) people create email with
clients that
output email with HTML codes (Internet Explorer for example)..

I am not really interested in any attachment, pictures etc which are sent with the 
only the plain
email body is important.
For emails that contain HTML tags, I think that stripping the HTML tags will do enough 

I do though have a problem when dealing with emails in which text is Mime-encoded.
The Mime_Class from Manual encodes everything for example..

Before I spend a great deal of time making some code which can decode and strip all the
diferent email-client formats, isn't there a class out there which can get me the plain
text email body out of a raw retrieved email..??
The Mailling-list archives of this PHP maillinglist at
http://marc.theaimsgroup.com/?l=php-general for example contains very nicely stripped
emails of all the members..

Does anyone khow this is done..?

Thanks in advance for any help..

With kind regards..

David Bouw

PS: To give some examples of problems I see in the retrieved mail I have quoted some

//A stripslashes will do a lot for me..

Content-Type: text/plain;
Content-Transfer-Encoding: quoted-printable

This is a mail send to myself

Content-Type: text/html;
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<META content=3D"text/html; charset=3Diso-8859-1" =
<META content=3D"MSHTML 5.00.3314.2100" name=3DGENERATOR>

//I can probably us mime_decode, but I think that this will take quite some hours to

This is a MIME encoded message.
Created by html_mime_mail.class.
See http://www.heyes-computing.net/scripts/ for a copy.

Content-Type: multipart/alternative;boundary="=_c15b829df5ff4f43680605bb761b564f

Content-Type: text/plain
Content-Transfer-Encoding: base64


PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to