Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $errors = '';
- $myemail = 'info@theclientkiller.org';//<-----Put Your email address here.
- $bccemail = 'info@corporatecampaign.org';//<-----Put Your email address here.
- if(empty($_POST['name']) ||
- empty($_POST['email']) ||
- empty($_POST['message']))
- {
- $errors .= "\n Error: all fields are required";
- }
- $name = $_POST['name'];
- $email_address = $_POST['email'];
- $message = $_POST['message'];
- // don't use stripslashes() because magic_quotes_gpc is deprecated
- // In case any of our lines are larger than 70 characters, we should use wordwrap()
- $message = wordwrap($message, 70, "\r\n");
- if (!preg_match(
- "/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i",
- $email_address))
- {
- $errors .= "\n Error: Invalid email address";
- }
- if( empty($errors))
- {
- $to = $myemail;
- $email_subject = "Contact form submission: $name";
- $email_body = "You have received a new message. ".
- " Here are the details:\n Name: $name \n Email: $email_address \n Message \n $message";
- $headers = "From: $myemail" . "\r\n";
- $headers .= "Reply-To: $email_address" . "\r\n" .;
- $headers .= "Bcc: $bccemail";
- mail($to,$email_subject,$email_body,$headers);
- //redirect to the 'thank you' page
- header('Location: thank_you_for_contacting_us.php');
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement