Join / Login Call Head Office, Limerick: 061 - 458703

Contact Us

Get in Touch!

Ennis Road Business Centre, Caherdavin, Limerick City, Ireland
+35361 458703

//If the form is submitted
if(isset($_POST['submit'])) {

//Check to make sure that the name field is not empty
if(trim($_POST['field-name']) == ”) {
$hasError = true;
} else {
$name = trim($_POST['field-name']);
}

//Check to make sure that the subject field is not empty
if(trim($_POST['field-subject']) == ”) {
$hasError = true;
} else {
$subject = trim($_POST['field-subject']);
}

//Check to make sure sure that a valid email address is submitted
if(trim($_POST['field-email']) == ”) {
$hasError = true;
} else if (!eregi(“^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$”, trim($_POST['field-email']))) {
$hasError = true;
} else {
$email = trim($_POST['field-email']);
}

//Check to make sure comments were entered
if(trim($_POST['field-message']) == ”) {
$hasError = true;
} else {
if(function_exists(‘stripslashes’)) {
$comments = stripslashes(trim($_POST['field-message']));
} else {
$comments = trim($_POST['field-message']);
}
}

//If there is no error, send the email
if(!isset($hasError)) {
$emailTo = ‘amitj@webpathfinders.com’;
$body = “Name: $name \n\nEmail: $email \n\nSubject: $subject \n\nComments:\n $comments”;
$headers = ‘From: My Site <’.$emailTo.’>’ . “\r\n” . ‘Reply-To: ‘ . $email;

mail($emailTo, $subject, $body, $headers);
$emailSent = true;
}
}
?>