Advertisement
romannovohackii

Subscribe.php

Jul 24th, 2012
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  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;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement