为什么最新的php邮件无法在Bamboozle上工作?

发布于 2025-01-31 13:15:41 字数 5921 浏览 5 评论 0原文

我一直在使用最新的PHP Mailer遇到问题。我尝试过切换代码,删除线路,将SMTP安全性从TLS更改为SSL以及更改端口,但是什么都没有。我正在使用我的Office 365 SMTP设置和凭据,这些设置都是有效且合法的。注意到,相同的代码,PHP Mailer和SMTP设置在Hostinger上工作。 那就是我

2022-05-22 08:01:37 Connection: opening to smtp.office365.com:587, timeout=300, 
options=array()
2022-05-22 08:01:39 Connection: opened
2022-05-22 08:01:39 SERVER -> CLIENT: 220-cp-dxb-001.bamboozle.me ESMTP Exim 4.95 #2 Sun, 22 
May 2022 12:01:39 +0400 220-We do not authorize the use of this system to transport 
unsolicited, 220 and/or bulk e-mail.
2022-05-22 08:01:39 CLIENT -> SERVER: EHLO eighty6.shop
2022-05-22 08:01:39 SERVER -> CLIENT: 250-cp-dxb-001.bamboozle.me Hello eighty6.shop 
[185.93.244.110]250-SIZE 52428800250-8BITMIME250-PIPELINING250-PIPE_CONNECT250-AUTH PLAIN 
LOGIN250-STARTTLS250 HELP
2022-05-22 08:01:39 CLIENT -> SERVER: STARTTLS
2022-05-22 08:01:39 SERVER -> CLIENT: 220 TLS go ahead
2022-05-22 08:01:39 Connection failed. Error #2: stream_socket_enable_crypto(): Peer 
certificate CN=`cp-dxb-001.bamboozle.me' did not match expected CN=`smtp.office365.com' 
[/home/eightysh/public_html/vendor/phpmailer/phpmailer/src/SMTP.php line 468]
SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): 
Peer certificate CN=`cp-dxb-001.bamboozle.me' did not match expected CN=`smtp.office365.com'
2022-05-22 08:01:39 CLIENT -> SERVER: QUIT
2022-05-22 08:01:39
2022-05-22 08:01:39
2022-05-22 08:01:39 Connection: closed
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

在主人的同时得到的

2022-05-22 07:22:09 Connection: opening to smtp.office365.com:587, timeout=300, 
options=array()
2022-05-22 07:22:09 Connection: opened
2022-05-22 07:22:09 SERVER -> CLIENT: 220 LO4P123CA0320.outlook.office365.com Microsoft ESMTP 
MAIL Service ready at Sun, 22 May 2022 07:22:09 +0000
2022-05-22 07:22:09 CLIENT -> SERVER: EHLO 86.tamvice.com
2022-05-22 07:22:09 SERVER -> CLIENT: 250-LO4P123CA0320.outlook.office365.com Hello 
[2a02:4780:a:1::3]250-SIZE 157286400250-PIPELINING250-DSN250-ENHANCEDSTATUSCODES250- 
STARTTLS250-8BITMIME250-BINARYMIME250-CHUNKING250 SMTPUTF8
2022-05-22 07:22:09 CLIENT -> SERVER: STARTTLS
2022-05-22 07:22:09 SERVER -> CLIENT: 220 2.0.0 SMTP server ready
2022-05-22 07:22:09 CLIENT -> SERVER: EHLO 86.tamvice.com
2022-05-22 07:22:09 SERVER -> CLIENT: 250-LO4P123CA0320.outlook.office365.com Hello 
[2a02:4780:a:1::3]250-SIZE 157286400250-PIPELINING250-DSN250-ENHANCEDSTATUSCODES250-AUTH LOGIN 
XOAUTH2250-8BITMIME250-BINARYMIME250-CHUNKING250 SMTPUTF8
2022-05-22 07:22:09 CLIENT -> SERVER: AUTH LOGIN
2022-05-22 07:22:09 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2022-05-22 07:22:09 CLIENT -> SERVER: [credentials hidden]
2022-05-22 07:22:09 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2022-05-22 07:22:09 CLIENT -> SERVER: [credentials hidden]
2022-05-22 07:22:13 SERVER -> CLIENT: 235 2.7.0 Authentication successful
2022-05-22 07:22:13 CLIENT -> SERVER: MAIL FROM:<[email protected]>
2022-05-22 07:22:14 SERVER -> CLIENT: 250 2.1.0 Sender OK
2022-05-22 07:22:14 CLIENT -> SERVER: RCPT TO:<[email protected]>
2022-05-22 07:22:14 SERVER -> CLIENT: 250 2.1.5 Recipient OK
2022-05-22 07:22:14 CLIENT -> SERVER: DATA
2022-05-22 07:22:14 SERVER -> CLIENT: 354 Start mail input; end with <CRLF>.<CRLF>
2022-05-22 07:22:14 CLIENT -> SERVER: Date: Sun, 22 May 2022 07:22:09 +0000
2022-05-22 07:22:14 CLIENT -> SERVER: To: [email protected]
2022-05-22 07:22:14 CLIENT -> SERVER: From: First Last <[email protected]>
2022-05-22 07:22:14 CLIENT -> SERVER: Reply-To: wissam baltaji <[email protected]>
2022-05-22 07:22:14 CLIENT -> SERVER: Subject: PHPMailer contact form
2022-05-22 07:22:14 CLIENT -> SERVER: Message-ID: 
<[email protected]>
2022-05-22 07:22:14 CLIENT -> SERVER: X-Mailer: PHPMailer 6.6.0 
(https://github.com/PHPMailer/PHPMailer)
2022-05-22 07:22:14 CLIENT -> SERVER: MIME-Version: 1.0
2022-05-22 07:22:14 CLIENT -> SERVER: Content-Type: text/plain; charset=iso-8859-1
2022-05-22 07:22:14 CLIENT -> SERVER:
2022-05-22 07:22:14 CLIENT -> SERVER: Email: [email protected]
2022-05-22 07:22:14 CLIENT -> SERVER: Name: wissam baltaji
2022-05-22 07:22:14 CLIENT -> SERVER: Message: 4r4r4r4r4r4r
2022-05-22 07:22:14 CLIENT -> SERVER:
2022-05-22 07:22:14 CLIENT -> SERVER: .
2022-05-22 07:22:14 SERVER -> CLIENT: 250 2.0.0 OK 
<[email protected]> 
[Hostname=DX1P273MB0952.AREP273.PROD.OUTLOOK.COM]
2022-05-22 07:22:14 CLIENT -> SERVER: QUIT
2022-05-22 07:22:14 SERVER -> CLIENT: 221 2.0.0 Service closing transmission channel
2022-05-22 07:22:14 Connection: closed

I've been having issues for days with the latest php mailer. I've tried switching codes, removing lines, changing smtp security from tls to ssl, and changing ports, but nothing is working. I'm using my office 365 smtp settings and credentials, which are all valid and legitimate. It is useful to note that the same code, php mailer, and smtp settings work on hostinger.
thats what i am getting

2022-05-22 08:01:37 Connection: opening to smtp.office365.com:587, timeout=300, 
options=array()
2022-05-22 08:01:39 Connection: opened
2022-05-22 08:01:39 SERVER -> CLIENT: 220-cp-dxb-001.bamboozle.me ESMTP Exim 4.95 #2 Sun, 22 
May 2022 12:01:39 +0400 220-We do not authorize the use of this system to transport 
unsolicited, 220 and/or bulk e-mail.
2022-05-22 08:01:39 CLIENT -> SERVER: EHLO eighty6.shop
2022-05-22 08:01:39 SERVER -> CLIENT: 250-cp-dxb-001.bamboozle.me Hello eighty6.shop 
[185.93.244.110]250-SIZE 52428800250-8BITMIME250-PIPELINING250-PIPE_CONNECT250-AUTH PLAIN 
LOGIN250-STARTTLS250 HELP
2022-05-22 08:01:39 CLIENT -> SERVER: STARTTLS
2022-05-22 08:01:39 SERVER -> CLIENT: 220 TLS go ahead
2022-05-22 08:01:39 Connection failed. Error #2: stream_socket_enable_crypto(): Peer 
certificate CN=`cp-dxb-001.bamboozle.me' did not match expected CN=`smtp.office365.com' 
[/home/eightysh/public_html/vendor/phpmailer/phpmailer/src/SMTP.php line 468]
SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): 
Peer certificate CN=`cp-dxb-001.bamboozle.me' did not match expected CN=`smtp.office365.com'
2022-05-22 08:01:39 CLIENT -> SERVER: QUIT
2022-05-22 08:01:39
2022-05-22 08:01:39
2022-05-22 08:01:39 Connection: closed
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

Meanwhile on my hostinger i am getting

2022-05-22 07:22:09 Connection: opening to smtp.office365.com:587, timeout=300, 
options=array()
2022-05-22 07:22:09 Connection: opened
2022-05-22 07:22:09 SERVER -> CLIENT: 220 LO4P123CA0320.outlook.office365.com Microsoft ESMTP 
MAIL Service ready at Sun, 22 May 2022 07:22:09 +0000
2022-05-22 07:22:09 CLIENT -> SERVER: EHLO 86.tamvice.com
2022-05-22 07:22:09 SERVER -> CLIENT: 250-LO4P123CA0320.outlook.office365.com Hello 
[2a02:4780:a:1::3]250-SIZE 157286400250-PIPELINING250-DSN250-ENHANCEDSTATUSCODES250- 
STARTTLS250-8BITMIME250-BINARYMIME250-CHUNKING250 SMTPUTF8
2022-05-22 07:22:09 CLIENT -> SERVER: STARTTLS
2022-05-22 07:22:09 SERVER -> CLIENT: 220 2.0.0 SMTP server ready
2022-05-22 07:22:09 CLIENT -> SERVER: EHLO 86.tamvice.com
2022-05-22 07:22:09 SERVER -> CLIENT: 250-LO4P123CA0320.outlook.office365.com Hello 
[2a02:4780:a:1::3]250-SIZE 157286400250-PIPELINING250-DSN250-ENHANCEDSTATUSCODES250-AUTH LOGIN 
XOAUTH2250-8BITMIME250-BINARYMIME250-CHUNKING250 SMTPUTF8
2022-05-22 07:22:09 CLIENT -> SERVER: AUTH LOGIN
2022-05-22 07:22:09 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2022-05-22 07:22:09 CLIENT -> SERVER: [credentials hidden]
2022-05-22 07:22:09 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2022-05-22 07:22:09 CLIENT -> SERVER: [credentials hidden]
2022-05-22 07:22:13 SERVER -> CLIENT: 235 2.7.0 Authentication successful
2022-05-22 07:22:13 CLIENT -> SERVER: MAIL FROM:<[email protected]>
2022-05-22 07:22:14 SERVER -> CLIENT: 250 2.1.0 Sender OK
2022-05-22 07:22:14 CLIENT -> SERVER: RCPT TO:<[email protected]>
2022-05-22 07:22:14 SERVER -> CLIENT: 250 2.1.5 Recipient OK
2022-05-22 07:22:14 CLIENT -> SERVER: DATA
2022-05-22 07:22:14 SERVER -> CLIENT: 354 Start mail input; end with <CRLF>.<CRLF>
2022-05-22 07:22:14 CLIENT -> SERVER: Date: Sun, 22 May 2022 07:22:09 +0000
2022-05-22 07:22:14 CLIENT -> SERVER: To: [email protected]
2022-05-22 07:22:14 CLIENT -> SERVER: From: First Last <[email protected]>
2022-05-22 07:22:14 CLIENT -> SERVER: Reply-To: wissam baltaji <[email protected]>
2022-05-22 07:22:14 CLIENT -> SERVER: Subject: PHPMailer contact form
2022-05-22 07:22:14 CLIENT -> SERVER: Message-ID: 
<[email protected]>
2022-05-22 07:22:14 CLIENT -> SERVER: X-Mailer: PHPMailer 6.6.0 
(https://github.com/PHPMailer/PHPMailer)
2022-05-22 07:22:14 CLIENT -> SERVER: MIME-Version: 1.0
2022-05-22 07:22:14 CLIENT -> SERVER: Content-Type: text/plain; charset=iso-8859-1
2022-05-22 07:22:14 CLIENT -> SERVER:
2022-05-22 07:22:14 CLIENT -> SERVER: Email: [email protected]
2022-05-22 07:22:14 CLIENT -> SERVER: Name: wissam baltaji
2022-05-22 07:22:14 CLIENT -> SERVER: Message: 4r4r4r4r4r4r
2022-05-22 07:22:14 CLIENT -> SERVER:
2022-05-22 07:22:14 CLIENT -> SERVER: .
2022-05-22 07:22:14 SERVER -> CLIENT: 250 2.0.0 OK 
<[email protected]> 
[Hostname=DX1P273MB0952.AREP273.PROD.OUTLOOK.COM]
2022-05-22 07:22:14 CLIENT -> SERVER: QUIT
2022-05-22 07:22:14 SERVER -> CLIENT: 221 2.0.0 Service closing transmission channel
2022-05-22 07:22:14 Connection: closed

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

秋千易 2025-02-07 13:15:41

与尝试使用Gmail时,您的潜在问题完全相同。您的托管提供商正在重定向您的SMTP流量,其证书与您要求的主机名不符,因此拒绝连接。这是TLS确切地做它应该做的事情,因为这样做可以有效地对您的流量进行中型攻击,并且可以保护您免受此攻击。

该解决方案与您上次询问的完全相同。改用他们的邮件服务器(这将阻止您使用从地址使用),请他们允许出站SMTP而不此次重定向,或者使用更好的托管提供商。

You have exactly the same underlying problem as when you were trying to use gmail. Your hosting provider is redirecting your SMTP traffic and their certificate does not match the hostname you asked for, so it’s refusing to connect. This is TLS doing exactly what it is supposed to do, as by doing this they are effectively performing a machine-in-the-middle attack on your traffic, and it is protecting you from it.

The solution is exactly the same as the last time you asked. Use their mail server instead (which will prevent you using your From address), ask them to allow outbound SMTP without this redirection, or use a better hosting provider.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文