Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //include 'helper/fnc.php';
- if(isset($_GET['call']) == null)
- die();
- $fnc = $_GET['call'];
- $arg = $_POST;
- $fnc($arg);
- header('Content-type: application/json');
- /**
- *
- * Returns object to sender request
- *
- * @param string Function
- * @param array Argument
- * @return object return to sender
- *
- */
- function returnToSender($fnc,$argArray){
- $return = array();
- array_push($return,$fnc);
- array_push($return,$argArray);
- echo json_encode($return); // RETURN OBJECT NEVER FORGET !!!!
- }
- /**
- *
- * Returns object to sender request
- *
- * @param array
- * @return nothing
- *
- */
- function demo($arg){
- print_r($arg);
- returnToSender('demo',$arg);
- };
- function sendMail($arg){
- $name = $arg["nickname"];
- $text = $arg["text"];
- $steamid = $arg["steamid"];
- $form = $arg["form"];
- $email = "zskullfox@gmail.com";
- $message = "Bewerbung von: " . $name . "\r\n\r\n" . $text . "\r\n\r\nSteam ID: ". $steamid;
- require 'PHPMailer/PHPMailerAutoload.php';
- $mail = new PHPMailer;
- //Send mail using gmail
- $mail->IsSMTP(); // telling the class to use SMTP
- $mail->SMTPAuth = true; // enable SMTP authentication
- $mail->SMTPSecure = "ssl"; // sets the prefix to the servier
- $mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
- $mail->Port = 465; // set the SMTP port for the GMAIL server
- $mail->Username = $email; // GMAIL username
- $mail->Password = "philipp5693"; // GMAIL password
- //Typical mail data
- $mail->AddAddress($email, $name);
- $mail->SetFrom("admin@xof.at", "Admin");
- $mail->Subject = $form;
- $mail->Body = $message;
- try{
- $mail->Send();
- returnToSender('mailComplete',array('status' => true,"message"=> "Success!","formid" => "#" . $form ));
- } catch(Exception $e){
- returnToSender('mailComplete',array('status' => false,"message"=> $mail->ErrorInfo ,"formid" => "#" . $form ));
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement