daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Mar 20th, 2017 132 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. include_once('vendor/autoload.php');
  3.  
  4. if ($_SERVER['REQUEST_METHOD'] === 'POST') {
  5.    
  6.     $post = json_decode(file_get_contents('php://input'), true);
  7.  
  8.     $names = $post['names'];
  9.     $tel = $post['tel'];
  10.     $email = $post['mail'];
  11.  
  12.     $mail = new PHPMailer();   
  13.     $mail->isSMTP();
  14.     $mail->Host = 'vestor.nazwa.pl';
  15.     $mail->SMTPAuth = true;
  16.     $mail->Username = 'no-reply@vestor.nazwa.pl';
  17.     $mail->Password = '3wnf#vK%eR';
  18.     $mail->Port = 587;
  19.     $mail->CharSet = 'UTF-8';
  20.     $mail->IsHTML(true);
  21.     // $mail->SMTPDebug = 3;
  22.    
  23.     $body = $names . "<br/>" . $tel . "<br/>" . $email;
  24.            
  25.     $mail->Subject = 'Mila Obligacje';
  26.     $mail->Body    = $body;
  27.     $mail->AddAddress('obligacje@vestor.pl', 'Mila Obligacje');
  28.     //$mail->AddAddress('czyzas@gmail.com', 'Mila Obligacje');
  29.    
  30.     $mail->SetFrom('no-reply@vestor.nazwa.pl', 'Mila formularz');
  31.    
  32.     $success = true;
  33.        
  34.     if(!$mail->send()) {
  35.         $success = false;
  36.     }
  37.    
  38.     echo json_encode(array('data' => $success));
  39. }
  40.  
  41.  
  42. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top