Guest User

Untitled

a guest
Dec 13th, 2016
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. <?php
  2. require('phpmailer/class.phpmailer.php');
  3.  
  4. $mail = new PHPMailer();
  5. $mail->IsSMTP();
  6. $mail->SMTPDebug = 0;
  7. $mail->SMTPAuth = TRUE;
  8. $mail->SMTPSecure = "tls";
  9. $mail->Port = 587;
  10. $mail->Username = "mojoshoe";
  11. $mail->Password = "9q3rD69drN";
  12. $mail->Host = "mojoshoes.rs";
  13. $mail->Mailer = "smtp";
  14. $mail->SetFrom($_POST["userEmail"], $_POST["userName"]);
  15. $mail->AddReplyTo($_POST["userEmail"], $_POST["userName"]);
  16. $mail->AddAddress("ketyboka@gmail.com");
  17. $mail->Subject = $_POST["subject"];
  18. $mail->WordWrap = 80;
  19. $mail->MsgHTML($_POST["content"]);
  20. $mail->MsgHTML($_POST["adresa"]);
  21.  
  22. if(is_array($_FILES)) {
  23. $mail->AddAttachment($_FILES['attachmentFile']['tmp_name'],$_FILES['attachmentFile']['name']);
  24. }
  25.  
  26. $mail->IsHTML(true);
  27.  
  28. if(!$mail->Send()) {
  29. echo "<p class='error'>Problem pri slanju poruke.</p>";
  30. } else {
  31. echo "<p class='success'>Uspešno ste poslali poruku.</p>";
  32. }
  33. ?>
Add Comment
Please, Sign In to add comment