X-Git-Url: https://reisub.nsupdate.info/git/?a=blobdiff_plain;f=mailbox%2Fsend.php;fp=mailbox%2Fsend.php;h=347274f9c70ec7660b928648dab2b50ae757a039;hb=aa35c1b421d8c57c9b81a1467ec6b90cda681232;hp=0000000000000000000000000000000000000000;hpb=a1232a2a92d7fe320aa358ea68de75706e35dcf0;p=saltmail.git%2F.git
diff --git a/mailbox/send.php b/mailbox/send.php
new file mode 100644
index 0000000..347274f
--- /dev/null
+++ b/mailbox/send.php
@@ -0,0 +1,82 @@
+init();
+?>
+',$_POST['content']);
+ if (isloged()==1){
+ $split=preg_split('/@/',$_POST['mail_r']);
+ $cnt=count($split);
+ if ($cnt==2){
+ $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'=>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,
+ CURLOPT_SSL_VERIFYPEER => false
+ );
+ 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)){
+ header('Location: mailb.php?info='.L::errors_sslerror.' '.curl_error($curl));
+ }
+ else{
+ $info=curl_getinfo($curl,CURLINFO_HTTP_CODE);
+ if ($info==200){
+ header('Location: mailb.php?info='.L::errors_nonerror.'');
+ }
+ else{
+ header('Location: mailb.php?info='.L::errors_iderror_not.'');
+ }
+ }
+ }
+ 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,
+ CURLOPT_SSL_VERIFYPEER => false
+ );
+ 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 $out;
+ if (curl_error($curl)){
+ header('Location: mailb.php?info='.L::errors_sslerror.'');
+ }
+ else{
+ $info=curl_getinfo($curl,CURLINFO_HTTP_CODE);
+ if ($info==200){
+ header('Location: mailb.php?info='.L::errors_nonerror.'');
+ }
+ else{
+ header('Location: mailb.php?info='.L::errors_iderror_not.''.$out);
+ }
+ }
+ }
+ }
+ else{
+ header('Location: ../login.php');
+ }
+}
+
+?>