Hi,

'; $status=0; $count =0; $valid=0; $rentaltype_key = $_POST['rentaltype']; $ip = $_SERVER['REMOTE_ADDR']; $REFERER = $_SERVER['HTTP_REFERER']; $message .= '

Order '.$today.':

'; $message .= '

IP from ['.$ip.']

'; $message .= '

Long IP from ['.ip2long($ip).']

'; $message .= '

REFERER ['.$REFERER.']

'; if($rentaltype_key == "Vehicle rental"){ //自駕租車 $strStart = $_POST['car_rental_periodfrom'].$_POST['car_rental_periodfromtime']; $strEnd = $_POST['car_rental_periodto'].$_POST['car_rental_periodtotime']; $date1=date_create($strStart); $date2=date_create($strEnd); $diff=date_diff($date1,$date2); $message .=$diff->format("%R%a day(s) %h hour(s) Booking"); } if($rentaltype_key == "Chauffeur"){ //Chauffeur $strStart = $_POST['periodfrom'].$_POST['periodfromtime']; $strEnd = $_POST['periodto'].$_POST['periodtotime']; $date1=date_create($strStart); $date2=date_create($strEnd); $diff=date_diff($date1,$date2); $message .=$diff->format("%R%a day(s) %h hour(s) Booking"); } $message .= ''; foreach ($_POST as $key => $value){ //Debug //$message .= $key.'='.$value.'
'; //End of Debug if (in_array($key,$rentaltype[$rentaltype_key])){ //$message .= "Match found"; $bg_color = $count % 2 === 0 ? "#f2f2f2" : "white"; $message .= ""; $message .= ''; if (is_array($value)){ $message .= ''; }else { $message .= ''; } $message .= ''; $count++; }; } $message .= '
'.$key.''; foreach ($value as $sub_key => $sub_value){ $message .= $sub_value.'
'; } $message .= '
'.$value.'
'; $message .= 'Ref.: '.$tid; $message .= '
Thanks'; $subject = "[Macau Order]".$today."-Rent A car Order"; //Required Rentaltype if (!empty($_POST['rentaltype'])){ $valid=1; } if(isset($_POST)){ $ip = $_SERVER['REMOTE_ADDR']; //site recaptcha $secret = "6LcEyr0ZAAAAAF6uRV4eG2hiX2vAP9xRbAY1PNvK"; $recaptcha = $_POST['g-recaptcha-response']; $url = 'https://www.google.com/recaptcha/api/siteverify?secret='.$secret.'&response='.$recaptcha.'&remoteip='.$ip; $verify = file_get_contents($url); $responseKeys = json_decode($verify); //Backlist ip if(strpos($_SERVER['REMOTE_ADDR'], "172.71.184") === 0){die;} if(strpos($_SERVER['REMOTE_ADDR'], "172.68.10") === 0){die;} //check valid if($valid < 1) { //Production //if(intval($responseKeys["success"]) !== 1) { $status = 'err'; //echo '

Wrong captcha try again please!

'; } else { //Site captcha $message .= "
recaptcha-key:"; if($responseKeys->success=true){ //if(intval($responseKeys["success"]) !== 1) { $message .= 'Pass !'; //Production //Original //$smtp = new smtp('vangiek-com.mail.protection.outlook.com', '25',false,'', ''); //if( $smtp->sendmail('vangiekcarrental@gmail.com', 'no-reply-1@virentacar.com.mo', $subject, $message, "HTML")){ //Test //$status = 'ok'; // Send email //info@virentacar.com.mo //Test Sender //if( $smtp->sendmail('ccvong@gmail.com', "no-reply@virentacar.com.hk", $subject, $message, "HTML")){ //Production Sender //if( $smtp->sendmail('info@virentacar.com.mo', "no-reply@virentacar.com.hk", $subject, $message, "HTML")){ //using Sendgrid //Please change include $smtp = new smtp('smtp.sendgrid.net', '465',true,'apikey', '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'); //if( $smtp->sendmail('vangiekcarrental@gmail.com', 'no-reply@virentacar.com.mo', $subject, $message, "HTML")){ if( $smtp->sendmail('vangiekcarrental@gmail.com,no-reply@virentacar.com.mo', 'no-reply@virentacar.com.mo', $subject, $message, "HTML")){ $status = 'ok'; }else{ $status = 'err'; } } else { $message .= 'NA'; $status = 'err'; } /* //Site captcha V3 $message .= "
recaptcha-score:"; if($recaptcha->success==true){ $message .= $recaptcha->score; if($recaptcha->score >= 0.5) { $message .= 'Pass !'; } else { $message .= 'Spammer'; } } */ } } // Output status echo $status;die; ?>