|
Posted by Mike Scougall on 10/10/06 11:39
<chris_fieldhouse@hotmail.com> wrote in message
news:1139412284.395848.305720@o13g2000cwo.googlegroups.com...
> Hi,
>
> I have a script for processing emails,
> The script finds email sent to a particular alias, grabs the body text
> of the email and stores it into a database.
>
> Problem is that certain character like '_' sometimes get stored as =5F,
> and some email clients seem to add in =0D encoded characters.
>
> I store the text in an Mysql database, and depending on the message
> type I also set a flag to indicate whether its a plain text message, or
> a MIME message with HTML coding.
> Its alwasy the HTML messages that have the extra characters.
>
> here is the code segment I modified from php.net to break down the
> email structure and grab just the body text (not interested in storring
> any attachments).
>
> Any help would be appreciated.
>
You could try using addslashes($content) just before writing the string to
the DB. Use stripslashes() when you pull the string back out.
There are also strip_tags() and htmlspecialchars() functions that strip out
or convert HTML and PHP tags. You might find one of those useful.
HTH
------------------------------------
Mike S
Copywriting for the IT Professional
www.redmaplesoftware.com
Navigation:
[Reply to this message]
|