Advertisement
Guest User

Untitled

a guest
Sep 11th, 2016
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. if(isset($_POST['send'])){
  2.  
  3. $name = $_POST['sendName'];
  4. $email = $_POST['sendEmail'];
  5. $subject = $_POST['sendSubject'];
  6. $message = $_POST['sendMessage'];
  7. $password = $_POST['sendPass'];
  8.  
  9. require_once('phpmailer/class.phpmailer.php');
  10. require_once('phpmailer/class.smtp.php');
  11. $mail = new PHPMailer(); // create a new object
  12. $mail->IsSMTP(); // enable SMTP
  13. $mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
  14. $mail->SMTPAuth = true; // authentication enabled
  15. //$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for Gmail
  16. $mail->Priority = 1; // Highest priority - Email priority (1 = High, 3 = Normal, 5 = low)
  17. $mail->CharSet = 'UTF-8';
  18. $mail->Host = "smtp.postmarkapp.com";
  19. $mail->Port = 2525; // or 587 //or 25
  20. $mail->IsHTML(true);
  21. $mail->Username = $email;
  22. $mail->Password = $password;
  23. $mail->From = $email;
  24. $mail->Subject = $subject;
  25. $mail->Body = $message;
  26. $mail->AddAddress("teste2x2016@gmail.com","jon");
  27.  
  28. if(!$mail->Send()) {
  29. echo "Mailer Error: " . $mail->ErrorInfo;
  30. } else {
  31. echo "Message has been sent";
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement