Guest User

Untitled

a guest
Feb 27th, 2018
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. $mail = new PHPMailer();
  2. try {
  3. $mail->SMTPDebug = 2;
  4. $mail->isSMTP();
  5. $mail->Host = 'smtp.myhost.com';
  6. $mail->SMTPAuth = true;
  7. $mail->Username = 'verify@mydomain.com';
  8. $mail->Password = 'mypass';
  9. $mail->SMTPSecure = false;
  10. $mail->Port = 25;
  11.  
  12. //Recipients
  13. $mail->setFrom('verify@mydomain.com');
  14. $mail->addAddress('recipient@test.com');
  15.  
  16. //Content
  17. $mail->isHTML(true);
  18. $mail->Subject = 'Here is the subject';
  19. $mail->Body = 'This is the HTML message body <b>in bold!</b>';
  20. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  21.  
  22. $mail->send();
  23. echo 'Message has been sent';
  24. } catch (Exception $e) {
  25. echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
  26. }
  27.  
  28. 2018-02-27 11:05:59 SERVER -> CLIENT:
  29. 2018-02-27 11:05:59 CLIENT -> SERVER: EHLO mydomain.com
  30. 2018-02-27 11:05:59 SERVER -> CLIENT:
  31. 2018-02-27 11:05:59 SMTP ERROR: EHLO command failed:
  32. 2018-02-27 11:05:59 CLIENT -> SERVER: HELO mydomain.com
  33. 2018-02-27 11:05:59 SERVER -> CLIENT:
  34. 2018-02-27 11:05:59 SMTP ERROR: HELO command failed:
  35. SMTP Error: Could not authenticate.
  36. 2018-02-27 11:05:59 CLIENT -> SERVER: QUIT
  37. 2018-02-27 11:05:59 SERVER -> CLIENT:
  38. 2018-02-27 11:05:59 SMTP ERROR: QUIT command failed:
  39. SMTP connect() failed.
  40. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Add Comment
Please, Sign In to add comment