$_POST['mail'], 'hash'=>$_POST['hash'],'channel'=>preg_split('/@/',$_POST['to'])[0]]; /** Configuring cURL with an array */ $other=array( CURLOPT_URL => 'https://'.preg_split('/@/',$_POST['mail'])[1].'/mailbox/user.php', CURLOPT_POST => true, CURLOPT_POSTFIELDS => $mail, CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYPEER => false ); /** INIT CURL */ $curl=curl_init(); /** SETTING THE ARRAY */ curl_setopt_array($curl, ($other)); /** RUN */ $out=curl_exec($curl); /** CHEKING RESPONSE */ if (curl_error($curl)){ http_response_code(400); } else{ /** GETTING CODE */ $info=curl_getinfo($curl,CURLINFO_HTTP_CODE); if ($info==200){ if (file_exists($_POST['to'].'/index.php')){ /** SAVING FILE */ $date=date('d/m/Y H:i:s'); $content=$date=date('d/m/Y H:i:s'); file_put_contents(preg_split('/@/',$_POST['to'])[0].'/mails/'.(string()).'.php',''); http_response_code(200); } else{ http_response_code(404); } } else{ echo $out; http_response_code(500); } } /** CLOSING */ curl_close($curl); } elseif (isset($_POST['mail']) and $_POST['to'] and isset($_POST['html']) and isset($_POST['hash']) and $type=='CHANNEL'){ /** Creating an array for send the data to the supposed server */ $mail=['mail'=>$_POST['mail'], 'hash'=>$_POST['hash'],'channel'=>preg_split('/@/',$_POST['to'])[0]]; /** Configuring cURL with an array */ $other=array( CURLOPT_URL => 'https://'.preg_split('/@/',$_POST['mail'])[1].'/mailbox/ismch.php', CURLOPT_POST => true, CURLOPT_POSTFIELDS => $mail, CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYPEER => false ); /** INIT CURL */ $curl=curl_init(); /** SETTING THE ARRAY */ curl_setopt_array($curl, ($other)); /** RUN */ $out=curl_exec($curl); /** CHEKING RESPONSE */ if (curl_error($curl)){ http_response_code(400); } else{ /** GETTING CODE */ $info=curl_getinfo($curl,CURLINFO_HTTP_CODE); if ($info==200){ if (file_exists($_POST['to'].'/index.php')){ /** SAVING FILE */ $date=date('d/m/Y H:i:s'); $content=$date=date('d/m/Y H:i:s'); file_put_contents(preg_split('/@/',$_POST['to'])[0].'/mails/'.(string()).'.php',''); http_response_code(200); } else{ http_response_code(404); } } else{ echo $out; http_response_code(500); } } /** CLOSING */ curl_close($curl); } elseif (isset($_POST['mail']) and $_POST['to'] and isset($_POST['html']) and isset($_POST['hash'])){ /** Creating an array for send the data to the supposed server */ $mail=['mail'=>$_POST['mail'], 'hash'=>$_POST['hash']]; /** Configuring cURL with an array */ $other=array( CURLOPT_URL => 'https://'.preg_split('/@/',$_POST['mail'])[1].'/mailbox/user.php', CURLOPT_POST => true, CURLOPT_POSTFIELDS => $mail, CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYPEER => false ); /** INIT CURL */ $curl=curl_init(); /** SETTING THE ARRAY */ curl_setopt_array($curl, ($other)); /** RUN */ $out=curl_exec($curl); /** CHEKING RESPONSE */ if (curl_error($curl)){ http_response_code(400); } else{ /** GETTING CODE */ $info=curl_getinfo($curl,CURLINFO_HTTP_CODE); echo $info; if ($info==200){ if (file_exists($_POST['to'].'/index.php')){ /** SAVING FILE */ $date=date('d/m/Y H:i:s'); $content=''; file_put_contents($_POST['to'].'/mails/'.string().'.php',$content); http_response_code(200); } else{ http_response_code(404); } } else{ echo $out; http_response_code(500); } } /** CLOSING */ curl_close($curl); } else{ http_response_code(404); } ?>