Guest User

Untitled

a guest
Jan 22nd, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. <?php
  2. header('Content-Type: text/html; charset=utf-8');
  3. if(isset($_POST['email'])) {
  4. $email_to = "myemail address here";
  5. $email_subject = "Request from my Website";
  6. $email_header = "my email address here";
  7. $name = $_POST['name']; // required
  8. $company = $_POST['phone']; // required
  9. $email_from = $_POST['email']; // required
  10. $demowhat = $_POST['message']; // required
  11. $email_message = "Form details below.nn";
  12.  
  13. function clean_string($string) {
  14. $bad = array("content-type","bcc:","to:","cc:","href");
  15. return str_replace($bad,"",$string); }
  16.  
  17. $email_message .= "Name: ".clean_string($name)."n";
  18. $email_message .= "Phone: ".clean_string($company)."n";
  19. $email_message .= "Email Address: ".clean_string($email_from)."n";
  20. $email_message .= "Message: ".clean_string($demowhat)."n";
  21. // create email headers
  22. $headers = 'From:'.$email_header."rn".
  23. 'Reply-To: '.$email_from."rn" .
  24. 'X-Mailer: PHP/' . phpversion();
  25. @mail($email_to, $email_subject, $email_message, $headers);
  26. ?>
Add Comment
Please, Sign In to add comment