Guest User

Untitled

a guest
Sep 2nd, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.65 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4.  
  5. require '../../PHPMailer-master/PHPMailerAutoload.php';
  6. // require '../../PHPMailer-master/class.smtp.php';
  7.  
  8. $mail = new PHPMailer(true);
  9. $mail->CharSet = 'UTF-8';
  10. $mail->SMTPDebug = false;
  11. $mail->isSMTP();
  12. $mail->Host = 'xxx.com.pl';
  13. $mail->SMTPAuth = true;
  14. $mail->Username = 'xxx@.com.pl';
  15. $mail->Password = 'xxx';
  16. $mail->Port = 587;
  17.  
  18.  
  19. $mail->setFrom('xxx@.com.pl', 'Centrum Giełdowe');
  20. $mail->addAddress('xxx@gmail.com', 'Odbiorca');
  21. $mail->Subject = "Wiadomość ze strony internetowej";
  22. $mail->isHTML(true);
  23.  
  24.  
  25. // $name = $_POST['InputName'];
  26. // $company = $_POST['InputFirma'];
  27. // $email = $_POST['InputEmail'];
  28. // $phone = $_POST['InputPhone'];
  29. // $message = $_POST['InputSubject'];
  30.  
  31.  
  32. $mail->Body = "Wiadomość od: " .$_POST['InputName']."nFirma: " .$_POST['InputFirma']. "nE-mail: " .$_POST['InputEmail']. "nTelefon: " .$phone = $_POST['InputPhone']. "nTreść wiadomości: " .$_POST['InputSubject'];
  33.  
  34. if(!$mail->send()) {
  35. echo 'Wiadomość nie mogła zostać wysłana';
  36. echo 'Mailer Error: ' . $mail->ErrorInfo;
  37. } else {
  38. echo 'Wiadomość została wysłana';
  39. }
  40.  
  41. <form class="padding-top-40" role="form" id="contactForm" class="contact-form" data-toggle="validator" class="shake">
  42. <div class="form-group">
  43. <label for="InputName">Imię i nazwisko</label>
  44. <input type="text" class="form-control" id="InputName" name="fullname" placeholder="Imię i nazwisko" required data-error="Proszę wpisać swoje imię i nazwisko">
  45. <div class="help-block with-errors"></div>
  46. </div>
  47. <div class="form-group">
  48. <label for="InputFirma">Firma</label>
  49. <input type="text" class="form-control" id="InputFirma" name="subject" name="comments" placeholder="Firma" required data-error="Proszę wpisać nazwę firmy">
  50. <div class="help-block with-errors"></div>
  51. </div>
  52. <div class="form-group">
  53. <label for="InputEmail">E-mail</label>
  54. <input type="email" class="form-control" id="InputEmail" name="emailid" placeholder="E-mail" required data-error="Proszę wpisać swój email">
  55. <div class="help-block with-errors"></div>
  56. </div>
  57. <div class="form-group">
  58. <label for="InputPhone">Telefon kontaktowy</label>
  59. <input type="number" class="form-control" name="phone" id="InputPhone" placeholder="Numer telefonu" required data-error="Proszę wprowadzić numer telefonu">
  60. <div class="help-block with-errors"></div>
  61. </div>
  62. <div class="form-group">
  63. <label for="InputSubject">Temat</label>
  64. <textarea type="text" class="form-control" name="subject" id="InputSubject" placeholder="Treść wiadomości" rows="4" required data-error="Proszę wpisać treść wiadomości"></textarea>
  65. <div class="help-block with-errors"></div>
  66. </div>
  67. <div class="padding-top-20">
  68. <button type="submit" value="send" class="btn btn-default" id="submit" >Wyślij</button>
  69. <div id="msgSubmit" class="h3 text-center"></div>
  70. </div>
  71. </form>
Add Comment
Please, Sign In to add comment