Posted By

gfazioli on 10/08/08


Tagged

php mail strip tags


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

tikitakfire
luman
gfazioli
nerdfiles
philsherry


Formatting PHP mail params


 / Published in: PHP
 

URL: http://www.undolog.com

The right way to send a mail with POST params

  1. if( isset( $_POST['name'] ) &&
  2. isset( $_POST['email'] ) &&
  3. isset( $_POST['subject'] ) &&
  4. isset( $_POST['message'] ) ) {
  5.  
  6. $to = 'Jon <[email protected]>';
  7.  
  8. mail($to, strip_tags( $_POST['subject'] ), stripslashes( utf8_decode( strip_tags( $_POST['message'] ) ) ), 'From: '.strip_tags( $_POST['name'] ).'<'.$_POST['email'].'>' );
  9. }

Report this snippet  

You need to login to post a comment.