Advertisement
Guest User

Untitled

a guest
Jul 17th, 2017
611
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. SMTP -> ERROR: Failed to connect to server: A connection attempt failed
  2. because the connected party did not properly respond after a period of time,
  3. or established connection failed because connected host has failed to
  4. respond. (10060)
  5. SMTP Error: Could not connect to SMTP host. Message could not be sent.
  6. Mailer Error: SMTP Error: Could not connect to SMTP host.
  7.  
  8. <?php
  9. $mail->IsSMTP();
  10. $mail->SMTPDebug = 2;
  11. $mail->SMTPSecure = 'tls';
  12. $mail->Host = "smtp.gmail.com";
  13. $mail->SMTPAuth = true;
  14. $mail->Username = "rammanoj.potla1608@gmail.com";
  15. $mail->Password = "marjo741963";
  16. $mail->port = 587;
  17. $mail->From = "rammanoj.potla@gmail.com";
  18. $mail->FromName = "rammanoj";
  19. $mail->AddAddress("rammanojpotla1608@gmail.com", "ram");
  20.  
  21. $mail->WordWrap = 50;
  22. $mail->IsHTML(true);
  23.  
  24. $mail->Subject = "Here is the subject";
  25. $mail->Body = "This is the HTML message body <b>in bold!</b>";
  26. $mail->AltBody = "This is the body in plain text for non-HTML mail clients";
  27.  
  28. if(!$mail->Send())
  29. {
  30. echo "Message could not be sent. <p>";
  31. echo "Mailer Error: " . $mail->ErrorInfo;
  32. exit;
  33. }
  34.  
  35. echo "Message has been sent";
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement