2 ini_set('display_errors',1);
3 ini_set('display_initial_errors',1);
4 error_reporting(E_ALL);
5 include '../i18n.class.php'; $i18n = new i18n('../lang/lang_{LANGUAGE}.ini'); $i18n->init();
8 include '../api/functions.php';
9 if (isset($_POST['content']) and isset($_POST['mail_r'])){
12 $split=preg_split('/@/',$_POST['mail_r']);
15 $query=mysqli_query($conn,'SELECT mail_password FROM mail WHERE mail_user="'.$_SESSION['m_user'].'"');
16 $hash=mysqli_fetch_array($query,MYSQLI_ASSOC)['mail_password'];
17 $mail=['mail'=>$_SESSION['m_user'],'html'=>$_POST['content'],'hash'=>$hash,'to'=>preg_split('/@/',$_POST['mail_r'])[0]];
19 CURLOPT_URL => 'https://'.$split[1].'mailbox/reicive.php',
21 CURLOPT_POSTFIELDS => $mail,
22 CURLOPT_RETURNTRANSFER => true
24 echo 'Sending sm to the url '.$split[1];
25 echo '<br> and to the mail id '.$split[0];
27 curl_setopt_array($curl, ($other));
28 $out=curl_exec($curl);
29 echo curl_error($curl);
30 if (curl_error($curl)){
31 header('Location: mailb.php?info=<text>'.L::errors_sslerror.'</text> '.curl_error($curl));
34 $info=curl_getinfo($curl,CURLINFO_HTTP_CODE);
36 header('Location: mailb.php?info=<text>'.L::errors_nonerror.'</text>');
39 header('Location: mailb.php?info=<text>'.L::errors_iderror_not.'</text>');
44 $selfUrl=$_SERVER['HTTP_HOST'].preg_replace('/mailbox\/send.php/','',$_SERVER['PHP_SELF']);
45 $query=mysqli_query($conn,'SELECT mail_password FROM mail WHERE mail_user="'.$_SESSION['m_user'].'"');
46 $hash=mysqli_fetch_array($query,MYSQLI_ASSOC)['mail_password'];
47 $mail=['mail'=>$_SESSION['m_user'],'html'=>$_POST['content'],'hash'=>$hash,'to'=>$split[0]];
49 CURLOPT_URL => 'https://'.$selfUrl.'mailbox/reicive.php',
51 CURLOPT_POSTFIELDS => $mail,
52 CURLOPT_RETURNTRANSFER => true
54 echo 'Sending sm to the url '.$selfUrl;
55 echo '<br> and to the mail id '.$split[0];
57 curl_setopt_array($curl, ($other));
58 $out=curl_exec($curl);
59 echo curl_error($curl);
60 if (curl_error($curl)){
61 header('Location: mailb.php?info=<text>'.L::errors_sslerror.'</text>');
64 $info=curl_getinfo($curl,CURLINFO_HTTP_CODE);
66 header('Location: mailb.php?info=<text>'.L::errors_nonerror.'</text>');
69 header('Location: mailb.php?info=<text>'.L::errors_iderror_not.'</text>');
75 header('Location: ../login.php');