2017-09-13 65 views
0

不用更改任何代碼,有時PHPMailer會使用SMTP和Outlook 365,有時它不會。
我試過SMTPDebug並比較結果,但它們幾乎是一樣的。
這在認證方面似乎失敗了,因爲您可以在底部看到。PHPMailer和Outlook 365有時可以運行

請幫忙!

這裏SMTPDebug> = 4次

成功

SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "220 SC1P215CA0018.outlook.office365.com Microsoft ESMTP MAIL Service ready at Wed, 13 Sep 2017 15:28:47 +0000 " 
SMTP -> get_lines(): $data is "220 SC1P215CA0018.outlook.office365.com Microsoft ESMTP MAIL Service ready at Wed, 13 Sep 2017 15:28:47 +0000 " 
SMTP -> FROM SERVER:220 SC1P215CA0018.outlook.office365.com Microsoft ESMTP MAIL Service ready at Wed, 13 Sep 2017 15:28:47 +0000 
SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] " 
SMTP -> get_lines(): $data is "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] " 
SMTP -> get_lines(): $data was "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] " 
SMTP -> get_lines(): $str is "250-SIZE 157286400 " 
SMTP -> get_lines(): $data is "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 " 
SMTP -> get_lines(): $data was "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 " 
SMTP -> get_lines(): $str is "250-PIPELINING " 
SMTP -> get_lines(): $data is "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING " 
SMTP -> get_lines(): $data was "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING " 
SMTP -> get_lines(): $str is "250-DSN " 
SMTP -> get_lines(): $data is "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN " 
SMTP -> get_lines(): $data was "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN " 
SMTP -> get_lines(): $str is "250-ENHANCEDSTATUSCODES " 
SMTP -> get_lines(): $data is "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES " 
SMTP -> get_lines(): $data was "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES " 
SMTP -> get_lines(): $str is "250-STARTTLS " 
SMTP -> get_lines(): $data is "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS " 
SMTP -> get_lines(): $data was "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS " 
SMTP -> get_lines(): $str is "250-8BITMIME " 
SMTP -> get_lines(): $data is "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-8BITMIME " 
SMTP -> get_lines(): $data was "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-8BITMIME " 
SMTP -> get_lines(): $str is "250-BINARYMIME " 
SMTP -> get_lines(): $data is "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-8BITMIME 250-BINARYMIME " 
SMTP -> get_lines(): $data was "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-8BITMIME 250-BINARYMIME " 
SMTP -> get_lines(): $str is "250-CHUNKING " 
SMTP -> get_lines(): $data is "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-8BITMIME 250-BINARYMIME 250-CHUNKING " 
SMTP -> get_lines(): $data was "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-8BITMIME 250-BINARYMIME 250-CHUNKING " 
SMTP -> get_lines(): $str is "250 SMTPUTF8 " 
SMTP -> get_lines(): $data is "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-8BITMIME 250-BINARYMIME 250-CHUNKING 250 SMTPUTF8 " 
SMTP -> FROM SERVER: 250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-8BITMIME 250-BINARYMIME 250-CHUNKING 250 SMTPUTF8 
SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "220 2.0.0 SMTP server ready " 
SMTP -> get_lines(): $data is "220 2.0.0 SMTP server ready " 
SMTP -> FROM SERVER:220 2.0.0 SMTP server ready 
SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] " 
SMTP -> get_lines(): $data is "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] " 
SMTP -> get_lines(): $data was "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] " 
SMTP -> get_lines(): $str is "250-SIZE 157286400 " 
SMTP -> get_lines(): $data is "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 " 
SMTP -> get_lines(): $data was "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 " 
SMTP -> get_lines(): $str is "250-PIPELINING " 
SMTP -> get_lines(): $data is "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING " 
SMTP -> get_lines(): $data was "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING " 
SMTP -> get_lines(): $str is "250-DSN " 
SMTP -> get_lines(): $data is "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN " 
SMTP -> get_lines(): $data was "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN " 
SMTP -> get_lines(): $str is "250-ENHANCEDSTATUSCODES " 
SMTP -> get_lines(): $data is "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES " 
SMTP -> get_lines(): $data was "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES " 
SMTP -> get_lines(): $str is "250-AUTH LOGIN XOAUTH2 " 
SMTP -> get_lines(): $data is "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH LOGIN XOAUTH2 " 
SMTP -> get_lines(): $data was "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH LOGIN XOAUTH2 " 
SMTP -> get_lines(): $str is "250-8BITMIME " 
SMTP -> get_lines(): $data is "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH LOGIN XOAUTH2 250-8BITMIME " 
SMTP -> get_lines(): $data was "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH LOGIN XOAUTH2 250-8BITMIME " 
SMTP -> get_lines(): $str is "250-BINARYMIME " 
SMTP -> get_lines(): $data is "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH LOGIN XOAUTH2 250-8BITMIME 250-BINARYMIME " 
SMTP -> get_lines(): $data was "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH LOGIN XOAUTH2 250-8BITMIME 250-BINARYMIME " 
SMTP -> get_lines(): $str is "250-CHUNKING " 
SMTP -> get_lines(): $data is "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH LOGIN XOAUTH2 250-8BITMIME 250-BINARYMIME 250-CHUNKING " 
SMTP -> get_lines(): $data was "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH LOGIN XOAUTH2 250-8BITMIME 250-BINARYMIME 250-CHUNKING " 
SMTP -> get_lines(): $str is "250 SMTPUTF8 " 
SMTP -> get_lines(): $data is "250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH LOGIN XOAUTH2 250-8BITMIME 250-BINARYMIME 250-CHUNKING 250 SMTPUTF8 " 
SMTP -> FROM SERVER: 250-SC1P215CA0018.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH LOGIN XOAUTH2 250-8BITMIME 250-BINARYMIME 250-CHUNKING 250 SMTPUTF8 
SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "334 VXNlcm5hbWU6 " 
SMTP -> get_lines(): $data is "334 VXNlcm5hbWU6 " 
SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "334 UGFzc3dvcmQ6 " 
SMTP -> get_lines(): $data is "334 UGFzc3dvcmQ6 " 
SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "235 2.7.0 Authentication successful target host BLUPR16MB0179.namprd16.prod.outlook.com " 
SMTP -> get_lines(): $data is "235 2.7.0 Authentication successful target host BLUPR16MB0179.namprd16.prod.outlook.com " 
SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "250 2.1.0 Sender OK " 
SMTP -> get_lines(): $data is "250 2.1.0 Sender OK " 
SMTP -> FROM SERVER:250 2.1.0 Sender OK 
SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "250 2.1.5 Recipient OK " 
SMTP -> get_lines(): $data is "250 2.1.5 Recipient OK " 
SMTP -> FROM SERVER:250 2.1.5 Recipient OK 
SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "354 Start mail input; end with . " 
SMTP -> get_lines(): $data is "354 Start mail input; end with . " 
SMTP -> FROM SERVER:354 Start mail input; end with . 
SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "250 2.6.0 [InternalId=93054761437225, Hostname=BLUPR16MB0179.namprd16.prod.outlook.com] 3346 bytes in 0.985, 3.315 KB/sec Queued mail for delivery " 
SMTP -> get_lines(): $data is "250 2.6.0 [InternalId=93054761437225, Hostname=BLUPR16MB0179.namprd16.prod.outlook.com] 3346 bytes in 0.985, 3.315 KB/sec Queued mail for delivery " 
SMTP -> FROM SERVER:250 2.6.0 [InternalId=93054761437225, Hostname=BLUPR16MB0179.namprd16.prod.outlook.com] 3346 bytes in 0.985, 3.315 KB/sec Queued mail for delivery 

錯誤

SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "220 SC1P15201CA0047.outlook.office365.com Microsoft ESMTP MAIL Service ready at Wed, 13 Sep 2017 15:21:14 +0000 " 
SMTP -> get_lines(): $data is "220 SC1P15201CA0047.outlook.office365.com Microsoft ESMTP MAIL Service ready at Wed, 13 Sep 2017 15:21:14 +0000 " 
SMTP -> FROM SERVER:220 SC1P15201CA0047.outlook.office365.com Microsoft ESMTP MAIL Service ready at Wed, 13 Sep 2017 15:21:14 +0000 
SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] " 
SMTP -> get_lines(): $data is "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] " 
SMTP -> get_lines(): $data was "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] " 
SMTP -> get_lines(): $str is "250-SIZE 157286400 " 
SMTP -> get_lines(): $data is "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 " 
SMTP -> get_lines(): $data was "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 " 
SMTP -> get_lines(): $str is "250-PIPELINING " 
SMTP -> get_lines(): $data is "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING " 
SMTP -> get_lines(): $data was "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING " 
SMTP -> get_lines(): $str is "250-DSN " 
SMTP -> get_lines(): $data is "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN " 
SMTP -> get_lines(): $data was "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN " 
SMTP -> get_lines(): $str is "250-ENHANCEDSTATUSCODES " 
SMTP -> get_lines(): $data is "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES " 
SMTP -> get_lines(): $data was "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES " 
SMTP -> get_lines(): $str is "250-STARTTLS " 
SMTP -> get_lines(): $data is "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS " 
SMTP -> get_lines(): $data was "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS " 
SMTP -> get_lines(): $str is "250-8BITMIME " 
SMTP -> get_lines(): $data is "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-8BITMIME " 
SMTP -> get_lines(): $data was "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-8BITMIME " 
SMTP -> get_lines(): $str is "250-BINARYMIME " 
SMTP -> get_lines(): $data is "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-8BITMIME 250-BINARYMIME " 
SMTP -> get_lines(): $data was "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-8BITMIME 250-BINARYMIME " 
SMTP -> get_lines(): $str is "250-CHUNKING " 
SMTP -> get_lines(): $data is "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-8BITMIME 250-BINARYMIME 250-CHUNKING " 
SMTP -> get_lines(): $data was "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-8BITMIME 250-BINARYMIME 250-CHUNKING " 
SMTP -> get_lines(): $str is "250 SMTPUTF8 " 
SMTP -> get_lines(): $data is "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-8BITMIME 250-BINARYMIME 250-CHUNKING 250 SMTPUTF8 " 
SMTP -> FROM SERVER: 250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-8BITMIME 250-BINARYMIME 250-CHUNKING 250 SMTPUTF8 
SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "220 2.0.0 SMTP server ready " 
SMTP -> get_lines(): $data is "220 2.0.0 SMTP server ready " 
SMTP -> FROM SERVER:220 2.0.0 SMTP server ready 
SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] " 
SMTP -> get_lines(): $data is "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] " 
SMTP -> get_lines(): $data was "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] " 
SMTP -> get_lines(): $str is "250-SIZE 157286400 " 
SMTP -> get_lines(): $data is "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 " 
SMTP -> get_lines(): $data was "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 " 
SMTP -> get_lines(): $str is "250-PIPELINING " 
SMTP -> get_lines(): $data is "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING " 
SMTP -> get_lines(): $data was "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING " 
SMTP -> get_lines(): $str is "250-DSN " 
SMTP -> get_lines(): $data is "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN " 
SMTP -> get_lines(): $data was "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN " 
SMTP -> get_lines(): $str is "250-ENHANCEDSTATUSCODES " 
SMTP -> get_lines(): $data is "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES " 
SMTP -> get_lines(): $data was "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES " 
SMTP -> get_lines(): $str is "250-AUTH LOGIN XOAUTH2 " 
SMTP -> get_lines(): $data is "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH LOGIN XOAUTH2 " 
SMTP -> get_lines(): $data was "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH LOGIN XOAUTH2 " 
SMTP -> get_lines(): $str is "250-8BITMIME " 
SMTP -> get_lines(): $data is "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH LOGIN XOAUTH2 250-8BITMIME " 
SMTP -> get_lines(): $data was "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH LOGIN XOAUTH2 250-8BITMIME " 
SMTP -> get_lines(): $str is "250-BINARYMIME " 
SMTP -> get_lines(): $data is "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH LOGIN XOAUTH2 250-8BITMIME 250-BINARYMIME " 
SMTP -> get_lines(): $data was "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH LOGIN XOAUTH2 250-8BITMIME 250-BINARYMIME " 
SMTP -> get_lines(): $str is "250-CHUNKING " 
SMTP -> get_lines(): $data is "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH LOGIN XOAUTH2 250-8BITMIME 250-BINARYMIME 250-CHUNKING " 
SMTP -> get_lines(): $data was "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH LOGIN XOAUTH2 250-8BITMIME 250-BINARYMIME 250-CHUNKING " 
SMTP -> get_lines(): $str is "250 SMTPUTF8 " 
SMTP -> get_lines(): $data is "250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH LOGIN XOAUTH2 250-8BITMIME 250-BINARYMIME 250-CHUNKING 250 SMTPUTF8 " 
SMTP -> FROM SERVER: 250-SC1P15201CA0047.outlook.office365.com Hello [X.X.X.X] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH LOGIN XOAUTH2 250-8BITMIME 250-BINARYMIME 250-CHUNKING 250 SMTPUTF8 
SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "334 VXNlcm5hbWU6 " 
SMTP -> get_lines(): $data is "334 VXNlcm5hbWU6 " 
SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "334 UGFzc3dvcmQ6 " 
SMTP -> get_lines(): $data is "334 UGFzc3dvcmQ6 " 
SMTP -> ERROR: Password not accepted from server: 
SMTP -> get_lines(): $data was "" 
SMTP -> get_lines(): $str is "235 2.7.0 Authentication successful target host CY1PR16MB0187.namprd16.prod.outlook.com " 
SMTP -> get_lines(): $data is "235 2.7.0 Authentication successful target host CY1PR16MB0187.namprd16.prod.outlook.com " 
SMTP -> FROM SERVER:235 2.7.0 Authentication successful target host CY1PR16MB0187.namprd16.prod.outlook.com 
SMTP -> ERROR: RSET failed: 235 2.7.0 Authentication successful target host CY1PR16MB0187.namprd16.prod.outlook.com 
SMTP Error: Could not authenticate. 

發送郵件功能

public function enviarCorreo($para, $cc = NULL, $nombre_desde, $asunto, $cuerpo, $adjunto) 
{ 
    $bd = new DB; 
    require_once(dirname(__FILE__) . '/../include/PHPMailer/class.phpmailer.php'); 

    try { 
     $mail = new PHPMailer(); 
    } 
    catch (Exception $e) { 
     echo "No se pudo instanciar el objeto Mail: ".$e->getMessage()."<br>"; 
    } 

    $sqlParamCorreo = $bd->query("SELECT * FROM parametros") or die ("Error parametros: ".mysql_error()); 

    if($sqlParamCorreo) 
     $correo = $bd->fetchObj(); 
    else 
     $correo = NULL; 

    $mail->SetLanguage("es", 'includes/phpMailer/language/'); 
    $mail->IsSMTP(); 
    $mail->SMTPDebug = 4; 

    $mail->Host = $correo->host_correo; // smtp.office365.com 

    $mail->SMTPAuth = true; 
    $mail->SMTPSecure = "tls"; 

    $mail->Port = $correo->puerto_correo; // 587 

    $mail->Username = $correo->usuario_correo; 
    $mail->Password = $correo->pass_correo; 

    $mail->SetFrom($correo->usuario_correo, $nombre_desde); 
    $mail->Subject = $asunto; 

    foreach($para as $destino) { 
     $mail->AddAddress($destino); 
    } 

    if(!is_null($cc)) { 
     foreach($cc as $destino_cc) { 
      $mail->AddCC($destino_cc); 
     } 
    } 

    if(!is_null($adjunto)) { 
     $aux = explode("_",$adjunto); 
     $nombre = "OC_".$aux[1]."_".$aux[2]; 
     $mail->AddAttachment($adjunto, $nombre);  
    } 

    $mail->IsHTML(true); 

    $mail->Body = $cuerpo; 

    if(!$mail->Send()) 
     return $mail->ErrorInfo; 

    else 
     return true; 
} 
+0

您是否注意到您的身份驗證失敗?密碼被拒絕 – 2017-09-13 17:13:27

+0

我會仔細看看你的sql。你從你的SQL數據庫中提取你的密碼 – 2017-09-13 17:17:31

+0

另外,我會看看你的錯誤日誌。我對此並不完全確定,但我認爲___你剛公開泄露了一個密碼/散列_ – 2017-09-13 17:20:08

回答

0

我將PHPMailer從5.2更新到6
現在它正在工作。謝謝Synchro
我在更新之前聯繫了Microsoft支持......並且他們說這是我的應用程序問題