64) { // local part length exceeded $isValid = false; } else if ($domainLen < 1 || $domainLen > 255) { // domain part length exceeded $isValid = false; } else if ($local[0] == '.' || $local[$localLen-1] == '.') { // local part starts or ends with '.' $isValid = false; } else if (preg_match('/\\.\\./', $local)) { // local part has two consecutive dots $isValid = false; } else if (!preg_match('/^[A-Za-z0-9\\-\\.]+$/', $domain)) { // character not valid in domain part $isValid = false; } else if (preg_match('/\\.\\./', $domain)) { // domain part has two consecutive dots $isValid = false; } else if(!preg_match('/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/', str_replace("\\\\","",$local))) { // character not valid in local part unless // local part is quoted if (!preg_match('/^"(\\\\"|[^"])+"$/', str_replace("\\\\","",$local))) { $isValid = false; } } if ($isValid && !(checkdnsrr($domain,"MX") || checkdnsrr($domain,"A"))) { // domain not found in DNS $isValid = false; } } return $isValid; } if (count($_POST) > 0) { function send_message($subject, $body) { $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD, 'api:key-9adftz9abuk7imno-08btsyse01l81z1'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); curl_setopt($ch, CURLOPT_URL, 'https://api.mailgun.net/v2/iorwerth.mailgun.org/messages'); curl_setopt($ch, CURLOPT_POSTFIELDS, array('from' => 'webmaster@iorwerth.com', 'to' => 'colin@iorwerth.com', 'subject' => $subject, 'text' => $body)); $result = curl_exec($ch); curl_close($ch); return $result; } $email = $_POST['email']; $subject = "Iorwerth Website Contact Form"; $name = $_POST['name']; $message = $_POST['message']; $message .= "\n\nName: " . $name; $message .= "\nEmail: " . $email; if (trim($email) == '') { $error_message = "Please enter your email address."; if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { header('Content-type: application/json'); $error_message = '{"message": "'.$error_message.'"}'; die($error_message); } } else if (!validEmail($email)) { $error_message = "Please enter a valid email address."; if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { header('Content-type: application/json'); $error_message = '{"message": "'.$error_message.'"}'; die($error_message); } } else { $result = send_message($subject, $message); if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { header('Content-type: application/json'); die($result); } $message_sent = true; } } include "header.html"; ?>

we love what we do!

contact us for a free quote

Contact us

We would love to hear from you. Drop us a line or send an email.

Iorwerth Software, Inc.
5510 Canotek Road, Suite 201
Ottawa, ON K1J 9J4
P: (613) 894-5038
Iorwerth Team
info@iorwerth.com
Thank you for your message.