Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $mail = new PHPMailer();
- try {
- $mail->SMTPDebug = 2;
- $mail->isSMTP();
- $mail->Host = 'smtp.myhost.com';
- $mail->SMTPAuth = true;
- $mail->Username = 'verify@mydomain.com';
- $mail->Password = 'mypass';
- $mail->SMTPSecure = false;
- $mail->Port = 25;
- //Recipients
- $mail->setFrom('verify@mydomain.com');
- $mail->addAddress('recipient@test.com');
- //Content
- $mail->isHTML(true);
- $mail->Subject = 'Here is the subject';
- $mail->Body = 'This is the HTML message body <b>in bold!</b>';
- $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
- $mail->send();
- echo 'Message has been sent';
- } catch (Exception $e) {
- echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
- }
- 2018-02-27 11:05:59 SERVER -> CLIENT:
- 2018-02-27 11:05:59 CLIENT -> SERVER: EHLO mydomain.com
- 2018-02-27 11:05:59 SERVER -> CLIENT:
- 2018-02-27 11:05:59 SMTP ERROR: EHLO command failed:
- 2018-02-27 11:05:59 CLIENT -> SERVER: HELO mydomain.com
- 2018-02-27 11:05:59 SERVER -> CLIENT:
- 2018-02-27 11:05:59 SMTP ERROR: HELO command failed:
- SMTP Error: Could not authenticate.
- 2018-02-27 11:05:59 CLIENT -> SERVER: QUIT
- 2018-02-27 11:05:59 SERVER -> CLIENT:
- 2018-02-27 11:05:59 SMTP ERROR: QUIT command failed:
- SMTP connect() failed.
- https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Add Comment
Please, Sign In to add comment