Guest User

Untitled

a guest
Apr 24th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. <?php
  2. # Change to your e-mail
  3. $recip = "anthony@kilnlabs.com";
  4. $from_header = "From: anthony@kilnlabs.com";
  5.  
  6. /**************************************************************************/
  7. $contact_name = $_POST['fromName'];
  8. $contact_email = $_POST['emailTo'];
  9. $contact_message = $_POST['message'];
  10.  
  11. $spamCheck = $_POST['javacheck'];
  12.  
  13. if ($spamCheck != "negative") {
  14. $headers = "MIME-Version: 1.0\n";
  15. $headers .= "Content-type: text/plain; charset=utf-8\n";
  16. $headers .= "X-Priority: 3\n";
  17. $headers .= "X-MSMail-Priority: Normal\n";
  18. $headers .= "X-Mailer: php\n";
  19. $headers .= $from_header;
  20.  
  21. // build up message
  22. // this code for any multiline text fields
  23. $message = str_replace("\r", "\n", $contact_message);
  24. // info vars
  25. $sender = $_SERVER[REMOTE_ADDR];
  26. // you can rearrange this - just do not add or remove quotes
  27. $mailbody = "Contact form send by:
  28. Name: $contact_name
  29. Email: $contact_email
  30.  
  31. Message:
  32. $contact_message
  33. -------
  34. sender's ip: $sender";
  35.  
  36. mail($recip, "Contact form", $mailbody, $headers);
  37. } else {
  38. echo "error";
  39. }
  40.  
  41. ?>
Add Comment
Please, Sign In to add comment