//send an email to client if($_POST['check_submit'] == 1) { if ($_POST['email'] == '') { $error = true; $email_error = true; } if ($_POST['name'] == '') { $error = true; $name_error = true; } if (!$error) { $mail_body = "A user has signed up to the mailing list via the website:\n"; $mail_body .= "Name: " . $_POST['name'] . "\n"; $mail_body .= "Email: " . $_POST['email'] . "\n"; $mail_body .= "Agreed to signup? " . ($_POST['add'] == 1 ? 'Yes' : 'No'); $to = "angie@angiedixey.co.uk"; $headers .= "From: \"". $_POST['email'] ."\"\n"; $headers .= "Reply-To: ".$_POST['email']."\n"; $headers .= 'Cc: jonny@bmore.co.uk' . "\r\n"; $subject = "Mailing list signup via the website"; mail($to,$subject,$mail_body,$headers); $good = true; } } //main contact form if($_POST['contact_submit'] == 1) { if ($_POST['contact_email'] == '') { $contact_error = true; $contact_err_email = true; } if ($_POST['contact_name'] == '') { $contact_error = true; $contact_err_name = true; } if (!$error) { $mail_body = "A user has sent a message via the website contact form:\n"; $mail_body .= "Name: " . $_POST['contact_name'] . "\n"; $mail_body .= "Email: " . $_POST['contact_email'] . "\n"; $mail_body .= "Phone: " . $_POST['contact_phone'] . "\n"; $mail_body .= "Message: " . $_POST['contact_message'] . "\n"; $to = "angie@angiedixey.co.uk"; $headers .= "From: " . $_POST['contact_name'] ."\nReply-To: ".$_POST['contact_email']."" . "\r\n"; $subject = "A user has sent a message via the website contact form"; mail($to,$subject,$mail_body,$headers); $good = true; } } ?>
Have you got a burning question or new idea? Would you like to find out more? Please use the contact form below and I will get back to you as soon as possible. Thanks!
if(!isset($_POST['contact_submit']) || isset($contact_error)) { ?> } elseif($good == true) { ?>Thank you for your comments, we will endeavour to respond as soon as possible.
} ?>