1

I have problem with sending emails with SMTP, using PHPMailer.

I have config file with optons for PPMailer, and class for sending. In every other server it works fine but with this not. Part of ini file:

mail.is_smtp = true
mail.host = "poczta.greenin.co"
mail.port = 25
mail.smtp_secure = "tls"
mail.smtp_auth = true
mail.username = "mail"
mail.password = "password"
mail.is_html = true

Part of class where the mailer is initialized:

            if ($options['is_smtp']) $this->_mailer->isSMTP();
            $this->_mailer->CharSet = 'UTF-8';
            $this->_mailer->Host = $options['host'];
            $this->_mailer->Port = $options['port'];
            $this->_mailer->SMTPAuth = $options['smtp_auth'];
            $this->_mailer->SMTPSecure = $options['smtp_secure'];
            $this->_mailer->Username = $options['username'];
            $this->_mailer->Password = $options['password'];
            $this->_mailer->SMTPOptions = array(
                'ssl' => array(
                    'verify_peer' => false,
                    'verify_peer_name' => false,
                    'allow_self_signed' => true
                )
            );
            var_dump($options);
            // $this->_mailer->AuthType = 'NTLM';
            $this->_mailer->SMTPDebug = 2;
            if ($options['is_html']) $this->_mailer->isHTML();

And now when I try to send email I've got that error:

2015-12-30 14:55:13 SERVER -> CLIENT: 220 GinEx.lawsolutions.local Microsoft ESMTP MAIL Service ready at Wed, 30 Dec 2015 15:56:37 +0100
2015-12-30 14:55:13 CLIENT -> SERVER: EHLO greenin.co
2015-12-30 14:55:13 SERVER -> CLIENT: 250-GinEx.lawsolutions.local Hello [79.96.212.138]
                                      250-SIZE 37748736
                                      250-PIPELINING
                                      250-DSN
                                      250-ENHANCEDSTATUSCODES
                                      250-STARTTLS
                                      250-X-ANONYMOUSTLS
                                      250-AUTH NTLM
                                      250-X-EXPS GSSAPI NTLM
                                      250-8BITMIME
                                      250-BINARYMIME
                                      250-CHUNKING
                                      250 XRDST
2015-12-30 14:55:13 CLIENT -> SERVER: STARTTLS
2015-12-30 14:55:14 SERVER -> CLIENT: 220 2.0.0 SMTP server ready
2015-12-30 14:55:14 CLIENT -> SERVER: EHLO greenin.co
2015-12-30 14:55:14 SERVER -> CLIENT: 250-GinEx.lawsolutions.local Hello [79.96.212.138]
                                      250-SIZE 37748736
                                      250-PIPELINING
                                      250-DSN
                                      250-ENHANCEDSTATUSCODES
                                      250-AUTH NTLM LOGIN
                                      250-X-EXPS GSSAPI NTLM
                                      250-8BITMIME
                                      250-BINARYMIME
                                      250-CHUNKING
                                      250 XRDST
2015-12-30 14:55:14 CLIENT -> SERVER: AUTH LOGIN
2015-12-30 14:55:14 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2015-12-30 14:55:14 CLIENT -> SERVER: xxxxx=
2015-12-30 14:55:14 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2015-12-30 14:55:14 CLIENT -> SERVER: xxxxx=
2015-12-30 14:55:19 SERVER -> CLIENT: 535 5.7.3 Authentication unsuccessful
2015-12-30 14:55:19 SMTP ERROR: Password command failed: 535 5.7.3 Authentication unsuccessful
2015-12-30 14:55:19 SMTP Error: Could not authenticate.
2015-12-30 14:55:19 CLIENT -> SERVER: QUIT
2015-12-30 14:55:19 SERVER -> CLIENT: 221 2.0.0 Service closing transmission channel
2015-12-30 14:55:19 SMTP connect() failed.

I diged through the internet for solutions, read many articles but none of them helped me. The password and username I use is correct, I properly login with it through OWA. I use the newest version of PHPMailer. I tried login with PLAIN and NTLM login type but it failed. I tried encoding password with base64, but it didn't help either.

Synchro
  • 35,538
  • 15
  • 81
  • 104
Manveru
  • 925
  • 1
  • 8
  • 24
  • This all looks correct, so you need to talk to your server admin about why this login is failing. In the login auth protocol the ID and password are base64-encoded, so what you had posted contained an easily-decoded id and password, so I removed them, and I suggest you change them. – Synchro Dec 30 '15 at 16:08

0 Answers0