RE: [PHP] [Q] mail() & security
| From: | Chris W. Parker | Date: | Mon, 04 Apr 2005 21:56:56 +0000 |
| Subject: | RE: [PHP] [Q] mail() & security | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-212211@lists.php.net to get a copy of this message | ||
Eric Gorr <mailto:mailist@ericgorr.net>
on Monday, April 04, 2005 2:01 PM said:
> The only concern I had was how to process the body text. Any
> recommendations?
>
> One useful function would appear to be strip_tags, so no one could
> embed annoying or destructive HTML, etc. which I may accidentally
> cause my e-mail application to render.
>
> Any other suggestions?
Maybe:
www.php.net/addslashes
www.php.net/htmlentities
Whatever you do don't strip out line breaks. I find it really annoying
when I neatly format (read "use paragraphs") a message in a contact form
just to find out that all those pretty line breaks are removed, turning
my nice message into a difficult to read blob.
Chris.