Fixing phpBB SMTP Email Error: “Could not get mail server response codes”

I recently ran into an issue while setting up email on my phpBB forum. The error message was: “Could not get mail server response codes” when trying to connect to my mail server on port 465. The weird part? The email worked perfectly fine in Thunderbird with the exact same settings.

The Problem

My PHPBB forum was configured with:

  • SMTP server: mail.choveshkata.net
  • Port: 465
  • Authentication: LOGIN
  • SSL certificate verification enabled (using Let’s Encrypt)

Everything looked correct, but phpBB just couldn’t connect. Meanwhile, Thunderbird had no issues sending emails with the same credentials and port settings.

The Investigation

First, I validated that my SMTP server was working correctly by testing it in Thunderbird. Since email sent and received without issues, I knew the problem wasn’t with the mail server itself or my credentials.

The culprit turned out to be the port and how phpBB handles SSL/TLS connections.

Understanding Ports 465 vs 587

Here’s the technical bit that explains everything:

Port 465 (SMTPS – Implicit SSL)

  • The connection must be encrypted from the very first moment
  • Uses “implicit SSL” – encryption starts immediately when connecting
  • Requires specific PHP socket handling (ssl:// wrapper)

Port 587 (Submission Port – Explicit TLS/STARTTLS)

  • Connection starts unencrypted, then upgrades to TLS
  • Uses “explicit TLS” or “STARTTLS”
  • The modern standard for mail submission
  • More widely supported across applications

PHPBB wasn’t properly handling the implicit SSL connection required by port 465, even though the port itself was working fine (as proven by Thunderbird).

The Solution

Simply switching from port 465 to port 587 fixed the issue immediately. Port 587 with STARTTLS is what PHPBB expects and handles reliably.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.