In this repo i store all my websites, each in a different branch
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 line
889 B

  1. <?php
  2. $EmailTo = "marcel@haazen.xyz";
  3. $Name = Trim(stripslashes($_POST['Name']));
  4. $Subject = Trim(stripslashes($_POST['Subject']));
  5. $Email = Trim(stripslashes($_POST['Email']));
  6. $Message = Trim(stripslashes($_POST['Message']));
  7. // validation
  8. if (empty($_POST['Email']) || empty($_POST['Subject']) || empty($_POST['Message']) || empty($_POST['Name'])) {
  9. print "<meta http-equiv=\"refresh\" content=\"0;URL=contact\">";
  10. exit;
  11. }
  12. // prepare email body text
  13. $Body = "";
  14. $Body .= "Name: ";
  15. $Body .= $Name;
  16. $Body .= "\n";
  17. $Body .= "Email: ";
  18. $Body .= $Email;
  19. $Body .= "\n";
  20. $Body .= "Message: ";
  21. $Body .= $Message;
  22. $Body .= "\n";
  23. // send email
  24. $success = mail($EmailTo, $Subject, $Body, "From: <$Email>");
  25. // redirect to success page
  26. if ($success){
  27. print "<meta http-equiv=\"refresh\" content=\"0;URL=contact\">";
  28. }
  29. else{
  30. print "error";
  31. }
  32. ?>