Advertisement
Guest User

Untitled

a guest
May 2nd, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. <?php
  2. require 'PHPMailer\PHPMailerAutoload.php';
  3. require 'credentials.php';
  4.  
  5. $email = $_POST['email'];
  6.  
  7. $mail = new PHPMailer;
  8. $mail->isSMTP();
  9. $mail->SMTPDebug = 2;
  10. $mail->Debugoutput = 'html';
  11. $mail->Host = 'smtp.gmail.com';
  12. $mail->Port = '587';
  13. $mail->SMTPSecure = 'tls';
  14. $mail->SMTPAuth = true;
  15. $mail->Username = $username;
  16. $mail->Password = $password;
  17. $mail->setFrom($username);
  18. $mail->addAddress($email);
  19. $mail->Subject = 'You have signed up for 3rd Party OWL';
  20. $mail->Body = 'Welcome, the first match will be on May 30th';
  21.  
  22. //send the message, check for errors
  23. if (!$mail->send()) {
  24. echo "Mailer Error: " . $mail->ErrorInfo;
  25. } else {
  26. echo "Message sent!";
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement