Sanitizing post content for use in an email

I’m sending the content of a custom post type in a plain text email (it’s to send competition entries to a panel of judges), so I need to make sure that $post->post_content is correctly sanitized first.

Is there a filter I can use for this, or if not, what sanitization do I need to do?

Update: I’ve just found wp_strip_all_tags in wp-includes/formatting.php, is this what I need?

2 Answers
2

You will want to use sanitize_email(); as follows:

return( sanitize_email( $email ) );

Here is the Codex link so you have it: http://codex.wordpress.org/Function_Reference/sanitize_email

Cheers!

Leave a Comment