Hide Expand Copy Code $name = trim($_POST['name']); $email = $_POST['email']; $suburb = $_POST['suburb']; $mobile = $_POST['mobile']; $date = $_POST['date']; $time = $_POST['time']; $subject = $_POST['subject']; $comments = $_POST['comments']; $site_owners_email = 'alarmperth.com'; // Replace this with your own hosting email address $site_owners_name = 'ALARM PERTH'; // replace with your name if (strlen($name) < 2) { $error['name'] = "Please enter your name"; } if (!preg_match('/^[a-z0-9&\'\.\-_\+]+@[a-z0-9\-]+\.([a-z0-9\-]+\.)*+[a-z]{2}/is', $email)) { $error['email'] = "Please enter a valid email address"; } if (strlen($suburb) < 3) { $error['suburb'] = "Please enter your suburb."; } if (strlen($mobile) < 10) { $error['mobile'] = "Please enter your mobile no. Only numerics!!"; } if (strlen($date) < 3) { $error['date'] = "Please enter your booking date."; } if (strlen($time) < 3) { $error['time'] = "Please enter your booking time."; } if (strlen($subject) < 2) { $error['title'] = "Please enter a subject"; } if (strlen($comments) < 3) { $error['comments'] = "Please leave your message."; } if (!$error) { require_once('phpMailer/class.phpmailer.php'); $mail = new PHPMailer(); $mail->From = $email; $mail->FromName = $name; $mail->Subject = "Website Contact Form"; %