()[\.,;:@\" ]|(\\\[\\x00-\\x7F]))\\.?)+)|(\"((\\\[\\x00-\\x7F])|[^\\x0D\\x0A\"\\\])+\"))@((([[:alpha:]]([[:alnum:]]|-)*[[:alnum:]]))(\\.([[:alpha:]]([[:alnum:]]|-)*[[:alnum:]]))*|(#[[:digit:]]+)|(\\[([[:digit:]]{1,3}(\\.[[:digit:]]{1,3}){3})]))$/", $email); } unset($error); unset($confirm); if (isset($_POST['submit'])) { if (empty($_POST['sender']) || empty($_POST['email']) || empty($_POST['Address']) || empty($_POST['City']) || empty($_POST['Prov']) || empty($_POST['Postal']) || empty($_POST['Country']) || empty($_POST['Telephone'])) { $error = 'You must complete all required fields'; } if (!isset($error)) { if (!isEmail(stripData($_POST['email']))) { $error = 'Invalid data in Email - (Email)'; } } if (!isset($error)) { $body = ''; $body .= 'sender: ' . stripData($_POST['sender']) . "\n"; $body .= 'email: ' . stripData($_POST['email']) . "\n"; $body .= 'Address: ' . stripData($_POST['Address']) . "\n"; $body .= 'City: ' . stripData($_POST['City']) . "\n"; $body .= 'Prov: ' . stripData($_POST['Prov']) . "\n"; $body .= 'Postal: ' . stripData($_POST['Postal']) . "\n"; $body .= 'Country: ' . stripData($_POST['Country']) . "\n"; $body .= 'Telephone: ' . stripData($_POST['Telephone']) . "\n"; $body .= 'Fax: ' . stripData($_POST['Fax']) . "\n"; $fromName = stripData($_POST['sender']); $fromEmail = stripData($_POST['email']); if (@mail('info@colourschool.com', 'Form', $body, "From: $fromName <$fromEmail>\r\n" . "Reply-To: <$fromEmail>")) {; $confirm = 'Thank you - your information has been submitted.'; unset($_POST); } else { $error = 'Cannot send mail'; } } } ?>