Formatting PHP mail params


/ Published in: PHP
Save to your folder(s)

The right way to send a mail with POST params


Copy this code and paste it in your HTML
  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. }

URL: http://www.undolog.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.