Advertisement
Guest User

Untitled

a guest
Apr 29th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. <?php
  2. require_once dirname(__FILE__) . '/vendor/phpmailer/PHPMailerAutoload.php';
  3. $name = '';
  4. $phone = '';
  5. $message = '';
  6. // adres strony
  7. $address = "https://ryzowapark.pl/";
  8. $redirectAddress = "https://ryzowapark.pl/";
  9. $name = isset($_POST['name']) ? $_POST['name'] : null;
  10. $phone = isset($_POST['phone']) ? $_POST['phone'] : '';
  11. $message = isset($_POST['message']) ? $_POST['message'] : 'Brak';
  12. // mail account configuration
  13. $mail = new PHPMailer;
  14. $mail->SMTPDebug = 3; // Enable verbose debug output
  15. //Server settings
  16. $mail->SMTPDebug = 0; // Enable verbose debug output
  17. $mail->isSMTP(); // Set mailer to use SMTP
  18. $mail->Host = 'ryzowaparkk.nazwa.pl'; // Specify main and backup SMTP servers
  19. $mail->SMTPAuth = true; // Enable SMTP authentication
  20. $mail->Username = 'sprzedaz@ryzowapark.pl'; // SMTP username
  21. $mail->Password = 'Chodkiewicza5'; // SMTP password
  22. $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
  23. $mail->Port = 465; // TCP port to connect to
  24. //Recipients
  25. $mail->setFrom('sprzedaz@ryzowapark.pl','Ryzowa Park');
  26. $mail->addAddress('kamil.jarzab@cravtt.com'); // Name is optional
  27. $mail->isHTML(true); // Set email format to HTML
  28. $mail->CharSet = 'UTF-8';
  29. $mail->Encoding = "base64";
  30. $mail->Subject = 'Ryzowa Park';
  31. $mail->Body = 'Imię i nazwisko: ' . $name . '<br>' . 'Telefon: ' . $phone . '<br>' . 'Wiadomość: ' . $message;
  32. $mail->AltBody = 'Imię i nazwisko: ' . $name . PHP_EOL . 'Telefon: ' . $phone . PHP_EOL . 'Wiadomość: ' . $message;
  33. if(!$mail->send()) {
  34. echo "Message has not been send";
  35. }else{
  36. echo "Message sent!";
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement