Advertisement
Guest User

Untitled

a guest
Jun 9th, 2014
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. <?php
  2.  
  3. $EmailFrom = "ljmerza@162.243.192.38.com";
  4. $EmailTo = "ljmerza@gmail.com";
  5. $Subject = "Audodevs Contact Form";
  6. $Name = trim(stripslashes($_POST['Name']));
  7. $Email = trim(stripslashes($_POST['Email']));
  8. $Message = trim(stripslashes($_POST['Message']));
  9.  
  10. // validation
  11. $validationOK=true;
  12. if (!$validationOK) {
  13. print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
  14. exit;
  15. }
  16.  
  17. // prepare email body text
  18. $Body = "";
  19. $Body .= "Name: ";
  20. $Body .= $Name;
  21. $Body .= "\n";
  22. $Body .= "Email: ";
  23. $Body .= $Email;
  24. $Body .= "\n";
  25. $Body .= "Message: ";
  26. $Body .= $Message;
  27. $Body .= "\n";
  28.  
  29. // send email
  30. $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
  31.  
  32. // redirect to success page
  33. if ($success){
  34. print "<meta http-equiv=\"refresh\" content=\"0;URL=contactthanks.php\">";
  35. }
  36. else{
  37. print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
  38. }
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement