Guest User

Untitled

a guest
Nov 1st, 2018
598
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. <?php
  2. require 'phpmailer/PHPMailerAutoload.php';
  3. $mail = new PHPMailer();
  4. $mail->isSMTP();
  5. $mail->Host = "smtp.gmail.com";
  6. $mail->SMTPSecure = "ssl";
  7. $mail->Port = 465;
  8. $mail->SMTPAuth = true;
  9. $mail->Username = 'test@gmail.com';
  10. $mail->Password = 'password';
  11. $mail->setFrom('test@gmail.com', 'test');
  12. $mail->addAddress('test@gmail.com');
  13. $mail->Subject = 'mail';
  14. $mail->IsHTML(true);
  15. $mail->Body = 'test';
  16. if(!$mail->send()) {
  17. echo 'Message could not be sent.';
  18. } else {
  19. echo '<script>alert("Message has been sent successfully");</script>';
  20. }
  21. ?>
Add Comment
Please, Sign In to add comment