Hi,

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

Order '.$today.':

'; $message .= '

IP from ['.$ip.']

'; //$message .= print_r($_POST); //$message .= $_POST; /* foreach ($_POST as $key => $value){ $message .=$key."-----".$value.'
'; } */ //Calculate Date and time if($rentaltype_key == "Vehicle rental"){ $strStart = $_POST['Retnal_periodfrom'].$_POST['Retnal_periodfromtime']; $strEnd = $_POST['Retnal_periodto'].$_POST['Retnal_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"); } //End of Calculate Date and time $message .= ''; foreach ($_POST as $key => $value){ 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 .= '
Thanks'; $subject = "[Macau Order]".$today."-Rent A card Order"; if(isset($_POST)){ $captcha=$_POST['g-recaptcha-response']; $ip = $_SERVER['REMOTE_ADDR']; $secretkey = "6LcEyr0ZAAAAAF6uRV4eG2hiX2vAP9xRbAY1PNvK"; //Invisible $response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secretkey."&response=".$captcha."&remoteip=".$ip); $responseKeys = json_decode($response,true); if(intval($responseKeys["success"]) !== 1) { $status = 'err'; //echo '

Wrong captcha try again please!

'; //Test Only $smtp = new smtp('vangiek-com.mail.protection.outlook.com', '25',false,'', ''); if( $smtp->sendmail('ccvong@gmail.com', "no-reply@virentacar.com.hk", $subject, $message, "HTML")){ $status = 'ok'; }else{ $status = 'err'; } //End Test } else { $smtp = new smtp('vangiek-com.mail.protection.outlook.com', '25',false,'', ''); //Test //$status = 'ok'; // Send email if( $smtp->sendmail('ccvong@gmail.com', "no-reply@virentacar.com.hk", $subject, $message, "HTML")){ $status = 'ok'; }else{ $status = 'err'; } } } // Output status echo $status;die; ?>