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'])){
11 $_POST['content']=str_replace('\n','<br>',$_POST['content']);
13 $split=preg_split('/@/',$_POST['mail_r']);
16 $query=mysqli_query($conn,'SELECT mail_password FROM mail WHERE mail_user="'.$_SESSION['m_user'].'"');
17 $hash=mysqli_fetch_array($query,MYSQLI_ASSOC)['mail_password'];
18 $mail=['mail'=>$_SESSION['m_user'],'html'=>$_POST['content'],'hash'=>$hash,'to'=>preg_split('/@/',$_POST['mail_r'])[0]];
20 CURLOPT_URL => 'https://'.$split[1].'mailbox/reicive.php',
22 CURLOPT_POSTFIELDS => $mail,
23 CURLOPT_RETURNTRANSFER => true,
24 CURLOPT_SSL_VERIFYPEER => false
26 echo 'Sending sm to the url '.$split[1];
27 echo '<br> and to the mail id '.$split[0];
29 curl_setopt_array($curl, ($other));
30 $out=curl_exec($curl);
31 echo curl_error($curl);
32 if (curl_error($curl)){
33 header('Location: mailb.php?info=<text>'.L::errors_sslerror.'</text> '.curl_error($curl));
36 $info=curl_getinfo($curl,CURLINFO_HTTP_CODE);
38 header('Location: mailb.php?info=<text>'.L::errors_nonerror.'</text>');
41 header('Location: mailb.php?info=<text>'.L::errors_iderror_not.'</text>');
46 $selfUrl=$_SERVER['HTTP_HOST'].preg_replace('/mailbox\/send.php/','',$_SERVER['PHP_SELF']);
47 $query=mysqli_query($conn,'SELECT mail_password FROM mail WHERE mail_user="'.$_SESSION['m_user'].'"');
48 $hash=mysqli_fetch_array($query,MYSQLI_ASSOC)['mail_password'];
49 $mail=['mail'=>$_SESSION['m_user'],'html'=>$_POST['content'],'hash'=>$hash,'to'=>$split[0]];
51 CURLOPT_URL => 'https://'.$selfUrl.'mailbox/reicive.php',
53 CURLOPT_POSTFIELDS => $mail,
54 CURLOPT_RETURNTRANSFER => true,
55 CURLOPT_SSL_VERIFYPEER => false
57 echo 'Sending sm to the url '.$selfUrl;
58 echo '<br> and to the mail id '.$split[0];
60 curl_setopt_array($curl, ($other));
61 $out=curl_exec($curl);
63 if (curl_error($curl)){
64 header('Location: mailb.php?info=<text>'.L::errors_sslerror.'</text>');
67 $info=curl_getinfo($curl,CURLINFO_HTTP_CODE);
69 header('Location: mailb.php?info=<text>'.L::errors_nonerror.'</text>');
72 header('Location: mailb.php?info=<text>'.L::errors_iderror_not.'</text>'.$out);
78 header('Location: ../login.php');