Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include_once('vendor/autoload.php');
- if ($_SERVER['REQUEST_METHOD'] === 'POST') {
- $post = json_decode(file_get_contents('php://input'), true);
- $names = $post['names'];
- $tel = $post['tel'];
- $email = $post['mail'];
- $mail = new PHPMailer();
- $mail->isSMTP();
- $mail->Host = 'vestor.nazwa.pl';
- $mail->SMTPAuth = true;
- $mail->Username = 'no-reply@vestor.nazwa.pl';
- $mail->Password = '3wnf#vK%eR';
- $mail->Port = 587;
- $mail->CharSet = 'UTF-8';
- $mail->IsHTML(true);
- // $mail->SMTPDebug = 3;
- $body = $names . "<br/>" . $tel . "<br/>" . $email;
- $mail->Subject = 'Mila Obligacje';
- $mail->Body = $body;
- $mail->AddAddress('obligacje@vestor.pl', 'Mila Obligacje');
- //$mail->AddAddress('czyzas@gmail.com', 'Mila Obligacje');
- $mail->SetFrom('no-reply@vestor.nazwa.pl', 'Mila formularz');
- $success = true;
- if(!$mail->send()) {
- $success = false;
- }
- echo json_encode(array('data' => $success));
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement