Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <?php
  2. require '/var/www/html/PHPMailer-master/PHPMailerAutoload.php';
  3.  
  4. $mail = new PHPMailer;
  5.  
  6. $mail->isSMTP();
  7. $mail->Host = 'mail.smtp2go.com';
  8. $mail->SMTPAuth = true;
  9. $mail->Username = 'erickwasambo@gmail.com';
  10. $mail->Password = 'gGXJUvb7PdML';
  11. $mail->SMTPSecure = 'tls';
  12.  
  13. $mail->From = 'sender@example.com';
  14. $mail->FromName = 'Your Name';
  15. $mail->addAddress('erick.wasambo@gmail.com');
  16.  
  17. $mail->isHTML(true);
  18.  
  19. $mail->Subject = 'Test Mail Subject!';
  20. $mail->Body = 'This is SMTP Email Test';
  21.  
  22. if(!$mail->send()) {
  23. echo 'Message could not be sent.';
  24. echo 'Mailer Error: ' . $mail->ErrorInfo;
  25. } else {
  26. echo 'Message has been sent';
  27. }
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement