'6Le5tw0UAAAAAJqdMZ6EdXmF_F7PIZ5KCOwYQ-FD', 'response' => $_POST['g-recaptcha-response'], 'remoteip' => $_SERVER['REMOTE_ADDR']]; $options = [ 'http' => [ 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($data) ] ]; $context = stream_context_create($options); $result = file_get_contents($url, false, $context); return json_decode($result)->success; } catch (Exception $e) { return null; } } require_once('class.phpmailer.php'); if( isset($_POST['g-recaptcha-response']) ) { if(! isValid() ) { header('Location: ' . $_SERVER['HTTP_REFERER']); } $name = isset($_POST['name']) ? trim(stripslashes($_POST['name'])) : ''; $phone = isset($_POST['phone']) ? trim(stripslashes($_POST['phone'])) : ''; $email = ( isset($_POST['email']) && filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) ) ? $_POST['email'] : ''; $message = isset($_POST['message']) ? trim(stripslashes($_POST['message'])) : ''; $referral = isset($_POST['referral']) ? trim(stripslashes($_POST['referral'])) : ''; $referralInfo = isset($_POST['referral-info']) ? trim(stripslashes($_POST['referral-info'])) : ''; // Let's do a last check if( ! empty($name) && ! empty($email) && ! empty($message) ) { $mail = new PHPMailer; $confirmationMail = new PHPMailer; $mail->ContentType = 'text/plain'; $mail->IsHTML(false); $confirmationMail->IsHTML(true); $msgBody = 'Name: '. $name ."\r\n" . 'Email: '. $email ."\r\n"; if($phone) { $msgBody .= 'Phone: '. $phone ."\r\n"; } if($referral) { $msgBody .= 'Referral: '. $referral; if($referralInfo) { $msgBody .= ' ('. $referralInfo .')'; } $msgBody .= "\r\n"; } $msgBody .= '--------------------------------' ."\r\n" . $message ."\r\n" . '--------------------------------' ."\r\n" . 'Sent via https://www.waterbaths.com/contact.html' ."\r\n" . 'Remote Addr: ' . $_SERVER['SERVER_ADDR'] ."\r\n" . 'Unique Tracking Code: ' . 'anova-scientific-'. strtoupper(uniqid()) . ' Please do not remove this code.' ."\r\n"; $mail->AddAddress('sales@waterbaths.com', 'Chemyx Waterbaths'); $mail->setFrom($email, $name); $mail->Subject = 'New Message Via Contact Form'; $mail->Body = $msgBody; $confirmationMail->AddAddress($email, $name); $confirmationMail->setFrom('sales@waterbaths.com', 'Chemyx Waterbaths'); $confirmationMail->Subject = '[Request Received] New Message Via Contact Form'; $confirmationMailContent = file_get_contents( __DIR__ . '/templates/contact-form-confirmation.html'); $confirmationMail->Body = $confirmationMailContent; if( $mail->Send() ) { //$confirmationMail->send(); header('Location: https://www.waterbaths.com/contact-confirmation.html'); } } } ?>
| Phone: | +1 281-277-2202 (Lab & Industry products) | |
| Fax : | +1 281-277-0045 | |
| Email: | sales@waterbaths.com | |
|
||
| Chemyx Waterbaths c/o Chemyx, Inc. 10905 Cash rd, Stafford, TX 77477 USA |