' . __('Please Enter Your Name', 'splinter') . '

'; } else { $senderName = trim($_POST['contact-name']); } if ( !isset($_POST['contact-email']) || empty($_POST['contact-email']) || trim($_POST['contact-email']) === '' ) { $formError = true; $formErrorMessages['emptyEmail'] = '

' . __('Please Enter Your Email Address', 'splinter') . '

'; } else if ( !filter_var(trim($_POST['contact-email']), FILTER_VALIDATE_EMAIL) ) { $formError = true; $formErrorMessages['invalidEmail'] = '

' . __('Please Enter A Valid Email Address', 'splinter') . '

'; } else { $senderEmail = trim($_POST['contact-email']); } if ( !isset($_POST['contact-message']) || empty($_POST['contact-message']) || trim($_POST['contact-message']) === '' ) { $formError = true; $formErrorMessages['emptyMessage'] = '

' . __('Please Enter A Message', 'splinter') . '

'; } else { $senderMessage = stripslashes(trim($_POST['contact-message'])); } if($formError) { echo '

' . __('Sorry, there are some errors...', 'splinter') . '

'; } else { $siteName = get_bloginfo('name'); $to = get_option('admin_email'); $subject = 'Message From ' . $senderName . ' - ' . $siteName . ' Contact Form'; $body = "Name: $senderName \n\nEmail: $senderEmail \n\nMessage: $senderMessage"; $headers = 'From: '.$senderName.' <'.$senderEmail.'>' . "\r\n" . 'Reply-To: ' . $senderEmail; wp_mail($to, $subject, $body, $headers); $messageSent = true; } } ?> ' . __('Thank You! We will respond to you shortly.', 'splinter') . '

'; } else { ?>