Advertisement
Guest User

Untitled

a guest
Dec 13th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 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.  
  21. if(is_array($_FILES)) {
  22. $mail->AddAttachment($_FILES['attachmentFile']['tmp_name'],$_FILES['attachmentFile']['name']);
  23. }
  24.  
  25. $mail->IsHTML(true);
  26.  
  27. if(!$mail->Send()) {
  28. echo "<p class='error'>Problem pri slanju poruke.</p>";
  29. } else {
  30. echo "<p class='success'>Uspešno ste poslali poruku.</p>";
  31. }
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement