Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header('Content-Type: text/html; charset=utf-8');
- if(isset($_POST['email'])) {
- $email_to = "myemail address here";
- $email_subject = "Request from my Website";
- $email_header = "my email address here";
- $name = $_POST['name']; // required
- $company = $_POST['phone']; // required
- $email_from = $_POST['email']; // required
- $demowhat = $_POST['message']; // required
- $email_message = "Form details below.nn";
- function clean_string($string) {
- $bad = array("content-type","bcc:","to:","cc:","href");
- return str_replace($bad,"",$string); }
- $email_message .= "Name: ".clean_string($name)."n";
- $email_message .= "Phone: ".clean_string($company)."n";
- $email_message .= "Email Address: ".clean_string($email_from)."n";
- $email_message .= "Message: ".clean_string($demowhat)."n";
- // create email headers
- $headers = 'From:'.$email_header."rn".
- 'Reply-To: '.$email_from."rn" .
- 'X-Mailer: PHP/' . phpversion();
- @mail($email_to, $email_subject, $email_message, $headers);
- ?>
Add Comment
Please, Sign In to add comment