Want more features on Pastebin? Sign Up, it's FREE!
Guest

Subscribe.php

By: romannovohackii on Jul 24th, 2012  |  syntax: PHP  |  size: 0.44 KB  |  views: 111  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php # Script must return TRUE (if allright) or FALSE (if e-mail not valid)
  2.  
  3. if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
  4.         echo 0;
  5.         exit;
  6. }
  7.  
  8. define('TO', 'romannovohackii@gmail.com'); // Your e-mail adress
  9. define('FROM', "From: My website <hello@{$_SERVER['HTTP_HOST']}>\r\n");
  10. define('SUBJECT', 'New subscribe'); // Subject of mail
  11. $message = $_POST['email'];
  12.  
  13. $r = mail(TO, SUBJECT, $message, FROM);
  14.  
  15. echo ($r) ? 1 : 0;
clone this paste RAW Paste Data