Guest User

LuMendoza

a guest
Oct 16th, 2013
261
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. // check if fields passed are empty
  3. if(empty($_POST['name']) ||
  4. empty($_POST['email']) ||
  5. empty($_POST['message']) ||
  6. !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
  7. {
  8. echo "No arguments Provided!";
  9. return false;
  10. }
  11.  
  12. $name = $_POST['name'];
  13. $email_address = $_POST['email'];
  14. $message = $_POST['message'];
  15.  
  16. // create email body and send it
  17. $to = 'reparaciones.lu@gmail.com'; // put your email
  18. $email_subject = "Contact form submitted by: $name";
  19. $email_body = "You have received a new message. \n\n".
  20. " Here are the details:\n \nName: $name \n ".
  21. "Email: $email_address\n Message \n $message";
  22. $headers = "From: contacts@myprogrammingblog.com\n";
  23. $headers .= "Reply-To: $email_address";
  24. mail($to,$email_subject,$email_body,$headers);
  25. return true;
  26. ?>
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×