Advertisement
Guest User

Untitled

a guest
Mar 5th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. <?php
  2. $name = trim( $_POST['name'] );
  3. $email = trim( $_POST['email'] );
  4. $subject = trim( $_POST['subject'] );
  5. $message = trim( $_POST['message'] );
  6. $message = "
  7. \n $name \n
  8. \n $email \n
  9. \n $subject \n
  10. \n $message \n
  11. ";
  12. echo $message;
  13. include "PHPMailer_5.2.4/class.phpmailer.php";
  14.  
  15.  
  16. $mail = new PHPMailer;
  17. $mail->isSMTP();
  18. $mail->Host = 'webh.email';
  19.  
  20. $mail->SMTPAuth = true;
  21. $mail->Username = 'cenzura';
  22. $mail->Password = 'cenzura';
  23. $mail->SMTPSecure = 'tls';
  24. $mail->Port = 587;
  25. $mail->setFrom('cenzura', 'Mailer');
  26. $mail->addAddress($_email, 'Name');
  27. $mail->addAttachment('fileaddress');
  28. $mail->isHTML(true);
  29. $mail->Subject = 'formularz';
  30. $mail->Body = $message;
  31. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  32.  
  33. if($mail->send()) {
  34.  
  35. echo 'success'; }
  36. else
  37. { echo 'unsuccess'; }
  38. }
  39. else // not validated
  40. {
  41. echo 'error';
  42. }
  43. // end if
  44.  
  45. }
  46. else // BOT DETECTED - lets lie to it
  47. {
  48. //echo "Thanks, We'll get back to you as soon as possible";
  49. echo 'success';
  50. }
  51. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement