SHARE
TWEET

Subscribe.php

romannovohackii Jul 24th, 2012 115 Never
  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;
RAW Paste Data
Top