Home > Enterprise >  Why latest PHP mailer not working on Bamboozle?
Why latest PHP mailer not working on Bamboozle?

Time:05-22

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

CodePudding user response:

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.

  • Related