From: borisd93 Date: Sun, 25 Apr 2021 13:56:22 +0000 (-0400) Subject: 0.3 First Public Versiob X-Git-Tag: 0.4.5-Beta~10 X-Git-Url: https://reisub.nsupdate.info/git/?p=smail.git%2F.git;a=commitdiff_plain;h=4e01ed8ebfb1867ded55cecf6f3766e8117ae33c;ds=sidebyside 0.3 First Public Versiob --- diff --git a/.none b/.none deleted file mode 100644 index 621e94f..0000000 --- a/.none +++ /dev/null @@ -1 +0,0 @@ -none diff --git a/README.md b/README.md index ddaf173..5f5d94e 100644 --- a/README.md +++ b/README.md @@ -12,5 +12,11 @@ SMail is a communication method, very different of the classic mail system. - Secure Mails and, you obligatory need a valid server to send mails, you not can send a message with a non-existing host. - Very new and multiplatform - Open Source -- We have now 1 official instance +- We have now 2 official instance +- Its a best way for have security and we have compatibility with symbian and other systems +# Donations + +[Programmer](https://liberapay.com/edkz) + +We need the donations because in my country the internet are very slow and limited \ No newline at end of file diff --git a/api/functions.php b/api/functions.php new file mode 100644 index 0000000..f27d40a --- /dev/null +++ b/api/functions.php @@ -0,0 +1,41 @@ + diff --git a/api/login.php b/api/login.php new file mode 100644 index 0000000..601728f --- /dev/null +++ b/api/login.php @@ -0,0 +1,52 @@ +Succefully_Loged'); + } + else{ + http_response_code(404); + echo json_encode('{password:404}'); + header('Location: ../login.php?info=The_user_or_password_was_incorrect'); + } + } + elseif ($_POST['mail']==$i['mail_user']){ + if (password_verify($_POST['password'],$i['mail_password'])){ + echo json_encode('{password:200}'); + $_SESSION['m_user']=$_POST['mail']; + $_SESSION['m_password']=$_POST['password']; + header('Location: ../mailbox/mailb.php?info=Succefully_Loged'); + } + else{ + http_response_code(404); + echo json_encode('{password:404}'); + header('Location: ../login.php?info=The_user_or_password_was_incorrect'); + } + } + else{ + $count=$count+1; + if ($count==$cnt){ + http_response_code(500); + echo json_encode('{user: 500}'); + break; + header('Location: ../login.php?info=The_user_or_password_was_incorrect'); + } + } + } +} +else{ + echo json_encode('{code: 400}'); +} +?> diff --git a/api/server_info.php b/api/server_info.php new file mode 100644 index 0000000..f122429 --- /dev/null +++ b/api/server_info.php @@ -0,0 +1,6 @@ + diff --git a/ch_p.php b/ch_p.php new file mode 100644 index 0000000..f27bcb4 --- /dev/null +++ b/ch_p.php @@ -0,0 +1,24 @@ + + + Login Smail + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/css/all.css b/css/all.css new file mode 100644 index 0000000..cd23df0 --- /dev/null +++ b/css/all.css @@ -0,0 +1,31 @@ +html{ + background: #30303c; +} +input,textarea{ + font-family: Bahnschrift; + border: none; +} +h1{ + font-size: 60px; +} +.mail,text,a{ + font-size: 30px; +} +h1,text{ + color: white; + font-family: Bahnschrift; +} +a{ + font-family: Bahnschrift; + color: yellowgreen; + text-decoration: none; +} +a:hover{ + color: aliceblue; + text-decoration: none; +} +@media (orientation: portrait){ + text,h1,a,input,textarea{ + font-size: 40px; + } +} \ No newline at end of file diff --git a/css/index.css b/css/index.css new file mode 100644 index 0000000..fc81562 --- /dev/null +++ b/css/index.css @@ -0,0 +1,10 @@ +a{ + text-decoration: none; + color: aliceblue; +} +a:hover{ + color: greenyellow; +} +text,h1{ + font-family: Bahnschrift; +} \ No newline at end of file diff --git a/css/mailbox.css b/css/mailbox.css new file mode 100644 index 0000000..e69de29 diff --git a/css/send.css b/css/send.css new file mode 100644 index 0000000..ab77d60 --- /dev/null +++ b/css/send.css @@ -0,0 +1,20 @@ +textarea{ + width: 100%; + display: flex; + justify-content: center; + border-radius: 0px; + height: 40%; + resize: none; + margin: 0px; +} +input{ + border-radius: 10px 10px 0px 0px; + width: 100%; + padding: 3px; +} +.submit{ + border-radius: 0px 0px 10px 10px; +} +.center{ + border-radius: 0px; +} \ No newline at end of file diff --git a/i18n.class.php b/i18n.class.php new file mode 100644 index 0000000..bde9e3b --- /dev/null +++ b/i18n.class.php @@ -0,0 +1,347 @@ +filePath = $filePath; + } + + if ($cachePath != NULL) { + $this->cachePath = $cachePath; + } + + if ($fallbackLang != NULL) { + $this->fallbackLang = $fallbackLang; + } + + if ($prefix != NULL) { + $this->prefix = $prefix; + } + } + + public function init() { + if ($this->isInitialized()) { + throw new BadMethodCallException('This object from class ' . __CLASS__ . ' is already initialized. It is not possible to init one object twice!'); + } + + $this->isInitialized = true; + + $this->userLangs = $this->getUserLangs(); + + // search for language file + $this->appliedLang = NULL; + foreach ($this->userLangs as $priority => $langcode) { + $this->langFilePath = $this->getConfigFilename($langcode); + if (file_exists($this->langFilePath)) { + $this->appliedLang = $langcode; + break; + } + } + if ($this->appliedLang == NULL) { + throw new RuntimeException('No language file was found.'); + } + + // search for cache file + $this->cacheFilePath = $this->cachePath . '/php_i18n_' . md5_file(__FILE__) . '_' . $this->prefix . '_' . $this->appliedLang . '.cache.php'; + + // whether we need to create a new cache file + $outdated = !file_exists($this->cacheFilePath) || + filemtime($this->cacheFilePath) < filemtime($this->langFilePath) || // the language config was updated + ($this->mergeFallback && filemtime($this->cacheFilePath) < filemtime($this->getConfigFilename($this->fallbackLang))); // the fallback language config was updated + + if ($outdated) { + $config = $this->load($this->langFilePath); + if ($this->mergeFallback) + $config = array_replace_recursive($this->load($this->getConfigFilename($this->fallbackLang)), $config); + + $compiled = "prefix . " {\n" + . $this->compile($config) + . 'public static function __callStatic($string, $args) {' . "\n" + . ' return vsprintf(constant("self::" . $string), $args);' + . "\n}\n}\n" + . "function ".$this->prefix .'($string, $args=NULL) {'."\n" + . ' $return = constant("'.$this->prefix.'::".$string);'."\n" + . ' return $args ? vsprintf($return,$args) : $return;' + . "\n}"; + + if( ! is_dir($this->cachePath)) + mkdir($this->cachePath, 0755, true); + + if (file_put_contents($this->cacheFilePath, $compiled) === FALSE) { + throw new Exception("Could not write cache file to path '" . $this->cacheFilePath . "'. Is it writable?"); + } + chmod($this->cacheFilePath, 0755); + + } + + require_once $this->cacheFilePath; + } + + public function isInitialized() { + return $this->isInitialized; + } + + public function getAppliedLang() { + return $this->appliedLang; + } + + public function getCachePath() { + return $this->cachePath; + } + + public function getFallbackLang() { + return $this->fallbackLang; + } + + public function setFilePath($filePath) { + $this->fail_after_init(); + $this->filePath = $filePath; + } + + public function setCachePath($cachePath) { + $this->fail_after_init(); + $this->cachePath = $cachePath; + } + + public function setFallbackLang($fallbackLang) { + $this->fail_after_init(); + $this->fallbackLang = $fallbackLang; + } + + public function setMergeFallback($mergeFallback) { + $this->fail_after_init(); + $this->mergeFallback = $mergeFallback; + } + + public function setPrefix($prefix) { + $this->fail_after_init(); + $this->prefix = $prefix; + } + + public function setForcedLang($forcedLang) { + $this->fail_after_init(); + $this->forcedLang = $forcedLang; + } + + public function setSectionSeparator($sectionSeparator) { + $this->fail_after_init(); + $this->sectionSeparator = $sectionSeparator; + } + + /** + * @deprecated Use setSectionSeparator. + */ + public function setSectionSeperator($sectionSeparator) { + $this->setSectionSeparator($sectionSeparator); + } + + /** + * getUserLangs() + * Returns the user languages + * Normally it returns an array like this: + * 1. Forced language + * 2. Language in $_GET['lang'] + * 3. Language in $_SESSION['lang'] + * 4. HTTP_ACCEPT_LANGUAGE + * 5. Language in $_COOKIE['lang'] + * 6. Fallback language + * Note: duplicate values are deleted. + * + * @return array with the user languages sorted by priority. + */ + public function getUserLangs() { + $userLangs = array(); + + // Highest priority: forced language + if ($this->forcedLang != NULL) { + $userLangs[] = $this->forcedLang; + } + + // 2nd highest priority: GET parameter 'lang' + if (isset($_GET['lang']) && is_string($_GET['lang'])) { + $userLangs[] = $_GET['lang']; + } + + // 3rd highest priority: SESSION parameter 'lang' + if (isset($_SESSION['lang']) && is_string($_SESSION['lang'])) { + $userLangs[] = $_SESSION['lang']; + } + + // 4th highest priority: HTTP_ACCEPT_LANGUAGE + if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { + foreach (explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $part) { + $userLangs[] = strtolower(substr($part, 0, 2)); + } + } + + // 5th highest priority: COOKIE + if (isset($_COOKIE['lang'])) { + $userLangs[] = $_COOKIE['lang']; + } + + // Lowest priority: fallback + $userLangs[] = $this->fallbackLang; + + // remove duplicate elements + $userLangs = array_unique($userLangs); + + // remove illegal userLangs + $userLangs2 = array(); + foreach ($userLangs as $key => $value) { + // only allow a-z, A-Z and 0-9 and _ and - + if (preg_match('/^[a-zA-Z0-9_-]*$/', $value) === 1) + $userLangs2[$key] = $value; + } + + return $userLangs2; + } + + protected function getConfigFilename($langcode) { + return str_replace('{LANGUAGE}', $langcode, $this->filePath); + } + + protected function load($filename) { + $ext = substr(strrchr($filename, '.'), 1); + switch ($ext) { + case 'properties': + case 'ini': + $config = parse_ini_file($filename, true); + break; + case 'yml': + case 'yaml': + $config = spyc_load_file($filename); + break; + case 'json': + $config = json_decode(file_get_contents($filename), true); + break; + default: + throw new InvalidArgumentException($ext . " is not a valid extension!"); + } + return $config; + } + + /** + * Recursively compile an associative array to PHP code. + */ + protected function compile($config, $prefix = '') { + $code = ''; + foreach ($config as $key => $value) { + if (is_array($value)) { + $code .= $this->compile($value, $prefix . $key . $this->sectionSeparator); + } else { + $fullName = $prefix . $key; + if (!preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $fullName)) { + throw new InvalidArgumentException(__CLASS__ . ": Cannot compile translation key " . $fullName . " because it is not a valid PHP identifier."); + } + $code .= 'const ' . $fullName . ' = \'' . str_replace('\'', '\\\'', $value) . "';\n"; + } + } + return $code; + } + + protected function fail_after_init() { + if ($this->isInitialized()) { + throw new BadMethodCallException('This ' . __CLASS__ . ' object is already initalized, so you can not change any settings.'); + } + } +} diff --git a/index.php b/index.php new file mode 100644 index 0000000..85eb192 --- /dev/null +++ b/index.php @@ -0,0 +1,40 @@ + +init(); include 'api/server_info.php';?> + + + SecureMail + + + + +
+

+
+
+
+

+
+ +
+
+

+
+ +
+
+

+
+ +
+
+

+
+ +
+
+

+
+ +
+ + \ No newline at end of file diff --git a/lang/lang_en.ini b/lang/lang_en.ini new file mode 100644 index 0000000..cdc0456 --- /dev/null +++ b/lang/lang_en.ini @@ -0,0 +1,38 @@ +[index] +welcome = "Welcome to the instance" +register = 'How i can create my own account?' +about = "What is SMail?" +how = "How i can use it?" +where = "Where i found the code?" +license = "What's its the license of SMail" +register_c = "You can register your own account here" +about_c = "SMail is a web based mail, easy to install and use" +how_c = "You can login here here and if you now are login you can send messages here and see your mailbox here" +where_c= "Project Code on Git" +license_c = "SMail was Licensed by GPL V3, The complete name of the project is Secure Mail." +[login] +incorrect = "The_user_or_the_password_are_incorrect" +correct = "Loged succefully" +postlogin_submit = "Sign in" +[send] +content = "Content" +send = "Send" +[mbox] +dhave = "You dont have any message's" +note = "Note: The horarie zone of this server are UTC 3" +send = "Send a message" +change = "Change password" +or = "or" +[gmail] +sender = "Sender" +content = "Contenido" +success = "Success" +return = "Return" +read = "Mark as read" +invalid_id = "Invalid ID" +or = "or" +[new] +already = "This user was already taken" +user = "User created, your new smail are " +[reg] +submit = "Sign up" \ No newline at end of file diff --git a/lang/lang_es.ini b/lang/lang_es.ini new file mode 100644 index 0000000..5ebeaa6 --- /dev/null +++ b/lang/lang_es.ini @@ -0,0 +1,37 @@ +[index] +welcome = "Bienvenido a la instancia" +register = "¿Como me registro?" +about = "¿Que es SMail?" +how = "¿Como puedo usar SMail?" +where = "¿Donde puedo encontrar el codigo?" +license = "¿Cual es la licencia de SMail?" +register_c = "Puedes registrarte aqui" +about_c = "SMail es un protocolo de email basado en web, facil de instalar y usar" +how_c = "Puedes iniciar sesion aqui y si ya estas logeado puedes mandar mensajes aqui y ver tu mailbox aqui" +where_c= "Codigo del proyecto en Git" +license_c = "SMail esta licenciado bajo GPL Version 3, el nombre completo del proyecto es Secure Mail" +[login] +incorrect = "El_usuario_o_la_contraseña_no_son_correctos" +correct = "Logeado correctamente" +postlogin_submit = "Iniciar sesion" +[send] +content = "Contenido" +send = "Enviar" +[mbox] +dhave = "No tienes ningun mensaje" +note = "Nota: La zona horaria de este servidor es UTC 3" +send = "Mandar un mensaje" +change = "Cambiar contraseña" +or = "o" +[gmail] +sender = "Desde" +content = "Contenido" +success = "Finalizado Correctamente" +return = "Volver" +read = "Marcar como leido" +or = "o" +[new] +already = "Este usuario ya esta tomado" +user= "Usuario creado, tu nuevo smail es " +[reg] +submit = "Registrar" \ No newline at end of file diff --git a/login.html b/login.html new file mode 100644 index 0000000..caa37ee --- /dev/null +++ b/login.html @@ -0,0 +1,19 @@ + + + Login Smail + + + + + +
+ + + +
+ + \ No newline at end of file diff --git a/login.php b/login.php new file mode 100644 index 0000000..1f34477 --- /dev/null +++ b/login.php @@ -0,0 +1,25 @@ +init();?> + + + Login Smail + + + + + + +
+ + + class='submit'> +
+ + \ No newline at end of file diff --git a/mailbox/change_p.php b/mailbox/change_p.php new file mode 100644 index 0000000..530e80e --- /dev/null +++ b/mailbox/change_p.php @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/mailbox/create_mf.php b/mailbox/create_mf.php new file mode 100644 index 0000000..3d27ba3 --- /dev/null +++ b/mailbox/create_mf.php @@ -0,0 +1,18 @@ +init();?> + + + + + + + '.L::gmail_success.', '.L::gmail_return.'';}catch(Exception $e){echo ''.L::gmail_return.'';} + } + } + elseif(isset($_GET['id'])){ + try{include preg_split('/@/',$_SESSION['m_user'])[0].'/'.$_GET['box'].'/'.$_GET['id'];echo ''.L::gmail_sender.': '.$sender.'
';echo ''.L::gmail_content.': '.$html;echo '
'.L::gmail_return.' or '.L::gmail_read.'';}catch (Exception $e){echo L::gmail_invalid_id;} + } + } + else{ + if (isset($_GET['delthem'])){ + if (strpos($_GET['delthem'],'/') or strpos($_GET['delthem'],'..') or strpos($_GET['delthem'],'\\')){} + else{ + try{unlink(preg_split('/@/',$_SESSION['m_user'])[0].'/mails/'.$_GET['delthem']);echo ''.L::gmail_success.', '.L::gmail_return.'';}catch(Exception $e){echo ''.L::gmail_return.'';} + } + } + elseif(isset($_GET['id'])){ + try{include preg_split('/@/',$_SESSION['m_user'])[0].'/mails/'.$_GET['id'];echo ''.L::gmail_sender.': '.$sender.'
';echo ''.L::gmail_content.': '.$html;echo '
'.L::gmail_return.' '.L::gmail_or.' '.L::gmail_read.'';}catch (Exception $e){echo L::gmail_invalid_id;} + } + } + } + else{ + http_response_code(404); + } + + ?> + + diff --git a/mailbox/index.php b/mailbox/index.php new file mode 100644 index 0000000..e69de29 diff --git a/mailbox/mailb.php b/mailbox/mailb.php new file mode 100644 index 0000000..d75f06a --- /dev/null +++ b/mailbox/mailb.php @@ -0,0 +1,70 @@ + +init();?> + + + + + + +

Mail Box

+ '; + } + function scan_dir($dir) { + $ignored = array('.', '..', '.htaccess','mailb.php','getmail.php'); + $files = array(); + foreach (scandir($dir) as $file) { + if (in_array($file, $ignored)) continue; + $files[$file] = filemtime($dir . '/' . $file); + } + arsort($files); + $files = array_keys($files); + return ($files) ? $files : false; + } + if (isloged()==1){ + if (isset($_GET['box'])){ + if (is_dir(preg_split('/@/',$_SESSION['m_user'])[0].'/'.$_GET['box']) and strpos($_GET['box'],'/')==false and strpos($_GET['box'],'..')==false or strpos($_GET['box'],'\\')==false){ + $dirs=scan_dir(getcwd().'/'.preg_split('/@/',$_SESSION['m_user'])[0].'/'.$_GET['box']); + if (($dirs==false)==false){ + foreach ($dirs as $i){ + $date=''; + include preg_split('/@/',$_SESSION['m_user'])[0].'/mails/'.$i; + echo ''.$sender.' '.$date.' Delete
+'; + } + } + } + } + else{ + $dirs=scan_dir(getcwd().'/'.preg_split('/@/',$_SESSION['m_user'])[0].'/mails/'); + if (($dirs==false)==false){ + foreach ($dirs as $i){ + $date=''; + include preg_split('/@/',$_SESSION['m_user'])[0].'/mails/'.$i; + echo ''.$sender.' '.$date.' Delete
+'; + } + } + else{ + echo ''.L::mbox_dhave.'
'; + } + } + } + else{ + http_response_code(404); + } + + ?> + +
+ + diff --git a/mailbox/move.php b/mailbox/move.php new file mode 100644 index 0000000..9043d73 --- /dev/null +++ b/mailbox/move.php @@ -0,0 +1,29 @@ +init();?> +'.L::new_user.' '.$_POST['mail'].'@'.$selfUrl.''); + } + else{ + header('Location: ../new_user.php?info='.L::new_already.' '.$_POST['mail'].'@'.$selfUrl.''); + } +} +else{ + header('Location: ../index.php'); +} +?> \ No newline at end of file diff --git a/mailbox/raw_mails.php b/mailbox/raw_mails.php new file mode 100644 index 0000000..47eea72 --- /dev/null +++ b/mailbox/raw_mails.php @@ -0,0 +1,39 @@ +'; + foreach (scan_dir(getcwd().'\\'.preg_split('/@/',$_SESSION['m_user'])[0].'\\'.$_GET['box'].'\\') as $d){ + include preg_split('/@/',$_SESSION['m_user'])[0].'\\'.$_GET['box'].'\\'.$d; + try{echo ''.$sender.' '.$date.'
';}catch (Exception $e){echo ''.$sender.'
';} + } + } + } + else{ + foreach (scan_dir(getcwd().'\\'.preg_split('/@/',$_SESSION['m_user'])[0]) as $d){ + foreach (scan_dir(getcwd().'\\'.preg_split('/@/',$_SESSION['m_user'])[0].'\\'.$d.'\\') as $i){ + include preg_split('/@/',$_SESSION['m_user'])[0].'\\'.$d.'\\'.$i; + echo ''.$sender.' '.$date.' '.$d.'
'; + } + } + } +} +else{ + header('Location: ../login.html'); +} +?> \ No newline at end of file diff --git a/mailbox/reicive.php b/mailbox/reicive.php new file mode 100644 index 0000000..6c00a17 --- /dev/null +++ b/mailbox/reicive.php @@ -0,0 +1,47 @@ +$_POST['mail'], 'hash'=>$_POST['hash']]; + $other=array( + CURLOPT_URL => 'https://'.preg_split('/@/',$_POST['mail'])[1].'/mailbox/user.php', + CURLOPT_POST => true, + CURLOPT_POSTFIELDS => $mail, + CURLOPT_RETURNTRANSFER => true + ); + $curl=curl_init(); + curl_setopt_array($curl, ($other)); + $out=curl_exec($curl); + if (curl_error($curl)){ + http_response_code(400); + } + else{ + $info=curl_getinfo($curl,CURLINFO_HTTP_CODE); + echo $info; + if ($info==200){ + if (file_exists($_POST['to'].'/index.php')){ + $date=date('Y-m-d H:i:s'); + $content=''.str_replace("'",'"',$_POST['html']).'"; +$sender="'.$_POST['mail'].'"; +$date="'.$date.'"; +?>'; + 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); + } + } + curl_close($curl); +} +else{ + http_response_code(404); +} +?> diff --git a/mailbox/remove_mf.php b/mailbox/remove_mf.php new file mode 100644 index 0000000..93d7071 --- /dev/null +++ b/mailbox/remove_mf.php @@ -0,0 +1,33 @@ +isDir()){ + rmdir($file->getRealPath()); + } else { + unlink($file->getRealPath()); + } + } + rmdir($dir); + echo 'Folder deleted'; + } + else{ + echo 'Folder not exists'; + } +} +else{ + if ($log==0){ + header('Location: ../login.html'); + } + else{} +} \ No newline at end of file diff --git a/mailbox/send.php b/mailbox/send.php new file mode 100644 index 0000000..da04d1e --- /dev/null +++ b/mailbox/send.php @@ -0,0 +1,77 @@ +$_SESSION['m_user'],'html'=>$_POST['content'],'hash'=>$hash,'to'=>preg_split('/@/',$_POST['mail_r'])[0]]; + $other=array( + CURLOPT_URL => 'https://'.$split[1].'mailbox/reicive.php', + CURLOPT_POST => true, + CURLOPT_POSTFIELDS => $mail, + CURLOPT_RETURNTRANSFER => true + ); + echo 'Sending sm to the url '.$split[1]; + echo '
and to the mail id '.$split[0]; + $curl=curl_init(); + curl_setopt_array($curl, ($other)); + $out=curl_exec($curl); + echo curl_error($curl); + if (curl_error($curl)){ + echo json_encode('{end: 400}'); + } + else{ + $info=curl_getinfo($curl,CURLINFO_HTTP_CODE); + echo $info; + if ($info==200){ + echo json_encode('{code:200, detail=mail sended}'); + } + else{ + echo json_encode('{code:404, detail=error}'); + } + } + } + elseif ($cnt==1){ + $selfUrl=$_SERVER['HTTP_HOST'].preg_replace('/mailbox\/send.php/','',$_SERVER['PHP_SELF']); + $query=mysqli_query($conn,'SELECT mail_password FROM mail WHERE mail_user="'.$_SESSION['m_user'].'"'); + $hash=mysqli_fetch_array($query,MYSQLI_ASSOC)['mail_password']; + $mail=['mail'=>$_SESSION['m_user'],'html'=>$_POST['content'],'hash'=>$hash,'to'=>$split[0]]; + $other=array( + CURLOPT_URL => 'https://'.$selfUrl.'mailbox/reicive.php', + CURLOPT_POST => true, + CURLOPT_POSTFIELDS => $mail, + CURLOPT_RETURNTRANSFER => true + ); + echo 'Sending sm to the url '.$selfUrl; + echo '
and to the mail id '.$split[0]; + $curl=curl_init(); + curl_setopt_array($curl, ($other)); + $out=curl_exec($curl); + echo curl_error($curl); + if (curl_error($curl)){ + echo json_encode('{end: 400}'); + } + else{ + echo $out; + $info=curl_getinfo($curl,CURLINFO_HTTP_CODE); + echo $info; + echo $out; + if ($info==200){ + echo json_encode('{code:200, detail=mail sended}'); + } + else{ + echo json_encode('{code:404, detail=error}'); + } + } + } + } + else{ + echo json_encode('{code:500, detail=unknow login}'); + } +} + +?> diff --git a/mailbox/user.php b/mailbox/user.php new file mode 100644 index 0000000..94876a3 --- /dev/null +++ b/mailbox/user.php @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/new_user.php b/new_user.php new file mode 100644 index 0000000..9a8d31f --- /dev/null +++ b/new_user.php @@ -0,0 +1,28 @@ +init();?> + + + + Register Smail + + + + + + +
+ + + class='submit'> +
+ + \ No newline at end of file diff --git a/send_m.php b/send_m.php new file mode 100644 index 0000000..a7caecd --- /dev/null +++ b/send_m.php @@ -0,0 +1,27 @@ + +init();?> + + + + + + + +
+ + + > +
+ +