Advertisement
Guest User

Untitled

a guest
Jun 13th, 2018
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. <?php
  2.  
  3. header('Content-type: text/html; charset=utf-8');
  4.  
  5. use PHPMailer\PHPMailer\PHPMailer;
  6. use PHPMailer\PHPMailer\Exception;
  7.  
  8. require 'phpmailer/src/Exception.php';
  9. require 'phpmailer/src/PHPMailer.php';
  10. require 'phpmailer/src/SMTP.php';
  11.  
  12. $imie = $_POST['webinsider-input-imie'];
  13. $email = $_POST['webinsider-input-email'];
  14. $tresc = $_POST['webinsider-input-tresc'];
  15. $temat = $_POST['webinsider-input-temat'];
  16.  
  17. date_default_timezone_set('Europe/Warsaw');
  18.  
  19. $mail = new PHPMailer(true);
  20. try {
  21. $mail->SMTPDebug = 2;
  22. $mail->isSMTP(); // Używamy SMTP
  23. $mail->Host = 'restauracjadk61.pl'; // Adres serwera SMTP
  24. $mail->SMTPAuth = true; // Autoryzacja (do) SMTP
  25. $mail->Username = 'test@restauracjadk61.pl'; // Nazwa użytkownika
  26. $mail->Password = 'zaq1@WSX'; // Hasło
  27. $mail->SMTPSecure = 'ssl'; // Typ szyfrowania (TLS/SSL)
  28. $mail->Port = 1; // Port
  29.  
  30. $mail->CharSet = "UTF-8";
  31. $mail->setLanguage('pl', '/phpmailer/language');
  32.  
  33. $mail->setFrom('test@restauracjadk61.pl', 'WebInsider.pl');
  34. $mail->addAddress('test@restauracjadk61.pl', 'Patryk');
  35.  
  36. $mail->isHTML(true); // Set email format to HTML
  37. $mail->Subject = 'Here is the subject';
  38. $mail->Body = 'This is the HTML message body <b>in bold!</b>';
  39. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  40.  
  41. $mail->send();
  42. echo 'Message has been sent';
  43. } catch (Exception $e) {
  44. echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
  45. }
  46. a
  47. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement