Guest User

Untitled

a guest
Apr 21st, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <?php
  2. $mailto = $_POST['mail_to'];
  3. $mailSub = $_POST['mail_sub'];
  4. $mailMsg = $_POST['mail_msg'];
  5. require 'PHPMailer-master/PHPMailerAutoload.php';
  6.  
  7. $mail = new PHPMailer();
  8. $mail ->IsSmtp();
  9. $mail ->SMTPDebug = 2;
  10. $mail ->SMTPAuth = true;
  11. $mail ->SMTPSecure = 'ssl';
  12. $mail ->Host = "smtp.gmail.com";
  13. $mail ->Port = 465; /* or 587;*/
  14. $mail ->IsHTML(true);
  15. $mail ->Username = "xxxxx";
  16. $mail ->Password = "xxxxx";
  17. $mail ->SetFrom("xxxxx");
  18. $mail ->Subject = $mailSub;
  19. $mail ->Body = $mailMsg;
  20. $mail ->AddAddress($mailto);
  21.  
  22. if(!$mail->Send())
  23. {
  24. echo "Mail Not Sent";
  25. }
  26. else
  27. {
  28. echo "Mail Sent";
  29. }
  30.  
  31. ?>
Add Comment
Please, Sign In to add comment