Advertisement
Guest User

Untitled

a guest
Sep 5th, 2017
552
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.26 KB | None | 0 0
  1. <?php
  2. ini_set('display_errors', 1);
  3. error_reporting(E_ERROR | E_WARNING);
  4. include '../PHPMailer/src/PHPMailer.php';
  5. include '../PHPMailer/src/Exception.php';
  6. use PHPMailer\PHPMailer\PHPMailer;
  7. use PHPMailer\PHPMailer\Exception;
  8.  
  9. require '../PHPMailer/src/PHPMailer.php';
  10. require '../PHPMailer/src/SMTP.php';
  11. require '../PHPMailer/src/Exception.php';
  12.  
  13.  
  14. $lang = $_COOKIE['lang'];
  15. $dane = $_POST['Dane'];
  16. $tel = $_POST['Telefon'];
  17. $email = $_POST['Email'];
  18. $adres = $_POST['Adres'];
  19. $model = $_POST['Model'];
  20. $rodzajpc = $_POST['RodzajPC'];
  21. $rodzajsys = $_POST['RodzajSys'];
  22. $opis = $_POST['Opis'];
  23. $zgoda1 = $_POST['Zgoda1'];
  24. $zgoda2 = $_POST['Zgoda2'];
  25. $outside = $_POST['Outside'];
  26. $cena = $_POST['Cena'];
  27. $uslugi = $_POST['Uslugi'];
  28. $rodzajpc = $_POST['RodzajPC'];
  29. echo "chuj";
  30. $mail = new PHPMailer(true);
  31. try {
  32.     //Server settings                                 // Enable verbose debug output
  33.     $mail->setLanguage('pl', '../PHPMailer/langugae/phpmailer.lang-pl.php');
  34.     $mail->isSMTP();                                      // Set mailer to use SMTP
  35.     $mail->Host = 'mail.infirmarypc.co.uk';  // Specify main and backup SMTP servers
  36.     $mail->SMTPAuth = true;                               // Enable SMTP authentication
  37.     $mail->Username = 'support@infirmarypc.co.uk';                 // SMTP username
  38.     $mail->Password = 'asdki123';                           // SMTP password
  39.     $mail->SMTPSecure = 'ssl';                            // Enable TLS encryption, `ssl` also accepted
  40.     $mail->Port = 25;                                    // TCP port to connect to
  41.    
  42.     $mail->setFrom('support@infirmarypc.co.uk', 'Infirmary PC Support');
  43.     $mail->addAddress($email, $dane);
  44.     $mail->isHTML(true);                                
  45.     $mail->Subject = "Zamowienie: ".$rodzajpc." Model: ".$model;
  46.     if(!isset($_COOKIE['lang']) || $lang == "en"){
  47.         $mail->Body    = file_get_contents('../html/szablon.html');
  48.     }
  49.     else{
  50.         $mail->Body    = file_get_contents('../html/szablon-pl.html');
  51.     }
  52.     $mail->addBCC('slawomir.glodzik@gmail.com');
  53.     $mail->addBCC('support@infirmarypc.co.uk');
  54.     $mail->addReplyTo($email, $dane);
  55.     if(!$mail->send()){
  56.         echo $mail->ErrorInfo;
  57.     $mail->send();
  58.     }
  59.     else
  60.         echo "chuj1";
  61. }
  62. catch (Exception $e) {
  63.     print_r($e);
  64.     echo $mail->ErrorInfo;
  65. }
  66. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement