Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

strip_tags incoming emails

Status
Not open for further replies.

Sleidia

Technical User
May 4, 2001
1,284
FR

Hello,

I've written a small anti-spam script that automatically deletes incoming messages based on their header/body section and I'm planning to add a feature that will apply a strip_tags function to the remaining messages before they get downloaded on my machine.

I see two ways of doing it :

1) make the script read the content of the message, parse it, copy the body section and send/copy it to a different mail box.

2) make the script directly parse the messages flat file for my account and re-write it.

So, what is the option should use?
And is there an even better option?

Thanks for helping !
 
for the tags you can use the

$messagenew = strip_tags($message, '<a><b><i><u><img><div><font><br>');

option

in this case ALL tags are stripped except for the ones below
'<a><b><i><u><img><div><font><br>'
 

Hello Hos2,

I know how to use the strip_tags() function, but my question was about the easiest/fastest way to achieve the goal without having to send the stripped message to another mailbox.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top