Advertisement
Guest User

Untitled

a guest
May 27th, 2017
601
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. <?php
  2. require './vendor/phpmailer/phpmailer/PHPMailerAutoload.php';
  3.  
  4. $mail = new PHPMailer;
  5.  
  6. //$mail->SMTPDebug = 3; // Enable verbose debug output
  7.  
  8. $mail->isSMTP(); // Set mailer to use SMTP
  9. $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
  10. $mail->SMTPAuth = true; // Enable SMTP authentication
  11. $mail->Username = 'donaldtrackerofficial@gmail.com'; // SMTP username
  12. $mail->Password = 'GibsonEk'; // SMTP password
  13. $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
  14. $mail->Port = 465; // TCP port to connect to
  15.  
  16. $mail->setFrom('donaldtrackerofficial@gmail.com', 'Test User');
  17. $mail->addAddress('joshfeinsilber@gmail.com', 'Josh Feinsilber'); // Add a recipient
  18.  
  19. $mail->isHTML(true); // Set email format to HTML
  20.  
  21. $mail->Subject = 'Here is the subject';
  22. $mail->Body = 'This is the HTML message body <b>in bold!</b>';
  23. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  24.  
  25. if(!$mail->send()) {
  26. echo 'Message could not be sent.';
  27. echo 'Mailer Error: ' . $mail->ErrorInfo;
  28. } else {
  29. echo 'Message has been sent';
  30. }
  31.  
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement