if(isset($_POST['message'])){
if(preg_match("/\b(?:(?:https?|ftp|http):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i",$_POST['message'])){
echo "";
return false;
}
if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])){
// Google reCAPTCHA API secret key
$secretKey = '6LckrIYrAAAAAJCDUFxtxDV0vvU0-YreEgQh2giV';
// Verify the reCAPTCHA response
$url = 'https://www.google.com/recaptcha/api/siteverify?secret='.$secretKey.'&response='.$_POST['g-recaptcha-response'];
// Decode json data
$ch = curl_init();
// Will return the response, if false it print the response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Set the url
curl_setopt($ch, CURLOPT_URL,$url);
// Execute
$result=json_decode(curl_exec($ch));
// Closing
curl_close($ch);
// If reCAPTCHA response is valid
if($result->success){
$html ='';
$html .='';
$html .='';
$html .='';
$html .='
';
$html .='
';
$html .='
Online Inquiry
';
$html .='
';
$html .='';
$html .='';
$html .='| Name | ';
$html .=''.$_POST['name'].' | ';
$html .='
';
$html .='';
$html .='| Email Address | ';
$html .=''.$_POST['email'].' | ';
$html .='
';
if($_POST['phone'] == true){
$html .='';
$html .='| Phone Number | ';
$html .=''.$_POST['phone'].' | ';
$html .='
';
}
if($_POST['subject'] == true){
$html .='';
$html .='| Subject | ';
$html .=''.$_POST['subject'].' | ';
$html .='
';
}
$html .='';
$html .='| Message | ';
$html .=''.$_POST['message'].' | ';
$html .='
';
$html .='';
$html .='
';
$html .='
';
$html .='
';
$html .='';
$html .='';
// echo $txt ; die();
$url = 'http://findamericanrentals.com/owner-login/sendgrid-mail';
$fields = array(
'html' => $html,
'keys' => 'dWx5NDlTTU5HcE44RGhiajNNcnk0dz09',//change here
'domain' => 'allsite',//change here
'subject' => 'Contact Inquiry From Ship Auto Now',
'to' => array('jonsonben1996@protonmail.com','office@shipautonow.com'),
'name' => $_POST['name'],
'fromname'=>$_POST['name'],
'replyto' => $_POST['email'],
'from' => 'from@shipautonow.com',
);
$fields_string = $fields;
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, true);
curl_setopt($ch,CURLOPT_POSTFIELDS, json_encode($fields_string));
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
$result = json_decode(curl_exec($ch));
if($result->status == 1){
echo "";
}else{
echo $result->message;
}
}
}else{
echo "";
}
}
?>
Contact Us
If you have any questions or would like to get in touch, please fill out the contact form. We’ll respond within 24 hours.