Welcome Guest, Not a member yet? Register   Sign In
SMTP fails on localhost
#11

(05-25-2021, 11:34 AM)akinuri Wrote: Guys, I appreciate the answers, but it appears none of you really examined the issue (the things I've posted).

No, the problem is not about an antivirus software. As I said, the email class in CI3 works, but the one in CI4 didn't work. This suggests that the problem is/was about CI4.

The code I've posted above is not arbitrary. It's something that I've tested. And I'm using the port 587. Also, I've mentioned using XAMPP. So all this is on dev/localhost.

Of course, it works on a live server (probably because you have a certificate there).

There's nothing wrong with the email server. The code works on a live server.

The problem is about the way email class in CI4 works. It's not the same as the email class in CI3.

I've already found the source of the problem, and managed to work around it. Now, all I need is an explanation.
Maybe you already understood but here is the explanation taken from CI4 documentation:


Quote:The key difference is that port 465 expects the communication channel to be secured using TLS from the start as per RFC 8314. A connection to port 587 allows clear-text connection and later will upgrade the channel to use encryption using the 

Code:
STARTTLS
 SMTP command.
Upgrading a connection on port 465 may or may not be supported by the server, so the 
Code:
STARTTLS
 SMTP command may fail if the server does not allow it. If you set the port to 465, you should try to leave the 
Code:
SMTPCrypto
 setting blank since the communication is secured using TLS from the start and the 
Code:
STARTTLS
 is not needed.
If your configuration requires you to connect to port 587, you should most likely set 
Code:
SMTPCrypto
 to 
Code:
tls
 as this will implement the 
Code:
STARTTLS
 command while communicating with the SMTP server to switch from clear-text to an encrypted channel. The initial communication will be made in clear-text and the channel will be upgraded to TLS with the 
Code:
STARTTLS
 command.
Reply
#12

I have same problem
Reply




Theme © iAndrew 2016 - Forum software by © MyBB