"."Phone: ".$phone."

".$message; $url='http://emsapi.demohind.com/api/mailer/post'; $fields=array( 'MailFrom'=>$from, 'MailTo'=>$to, 'MailSubject'=>$subject, 'MailBody'=>$body ); $headers=array( 'Content-Type:application/json' ); $ch = curl_init(); //Setting the curl url curl_setopt($ch, CURLOPT_URL, $url); //setting the method as post curl_setopt($ch, CURLOPT_POST, true); //adding headers curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0); //disabling ssl support curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //adding the fields in json format curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields)); $result = curl_exec($ch); if ($result === FALSE) { die('Curl failed: ' . curl_error($ch)); //echo 'failed'; }else{ //echo 'sent'; } //Now close the connection curl_close($ch); echo ""; exit(); ?>