Advertisement
Guest User

Untitled

a guest
Dec 17th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. 2016-12-17 19:41:24 SMTP ERROR: Failed to connect to server: (0) 2016-12-17 19:41:24 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting error
  2.  
  3. require_once 'PHPMailer-master/PHPMailerAutoload.php';
  4. $mail = new PHPMailer();
  5. $mail->IsSMTP();
  6. $mail->SMTPAuth = true;
  7. $mail->IsHTML(true);
  8. $mail->CharSet = "text/html; charset=UTF-8;";
  9. $mail->SMTPDebug = 2;
  10. $mail->SMTPSecure = 'ssl';
  11. $mail->Host = "smtp.gmail.com";
  12. $mail->Port = 465;
  13. $mail->Username = "google email address";
  14. $mail->Password = "password";
  15. $mail->From = $email_from;
  16. $mail->FromName = "Name";
  17. $mail->AddAddress($to);
  18. $mail->Subject = $subject;
  19. $mail->Body = $message;
  20. $sent = $mail->Send();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement