daily pastebin goal
62%
SHARE
TWEET

Untitled

a guest Apr 21st, 2018 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top