PHP服务器的PHPMailer密码命令失败

时间:2015-12-30 15:12:51

标签: php email exchange-server phpmailer

使用PHPMailer发送带有SMTP的电子邮件时遇到问题。

我有PPMailer的optons配置文件和发送类。 在其他所有服务器中,它工作正常,但事实并非如此。 ini档案的一部分:

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

初始化邮件程序的类的一部分:

            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();

现在,当我尝试发送电子邮件时,我遇到了错误:

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.

我通过互联网寻求解决方案,阅读了很多文章,但没有一个帮助我。 我使用的密码和用户名是正确的,我通过OWA正确登录。我使用最新版本的PHPMailer。我尝试使用PLAIN和NTLM登录类型登录但是失败了。我尝试用base64编码密码,但它也没有帮助。

0 个答案:

没有答案