Page 1 of 1

OC V3 PHP7.4 SMTP Issues: Error: EHLO not accepted from server!

Posted: Mon Apr 07, 2025 7:26 pm
by oursupersoftware
Hi,
I migrated my OC V3 installation as is from my previous shared hosting (using cPanel) to a Ubuntu VPS using php7.4, the site is running good except for the email sending from php.

I'm getting this error in the logs:

Code: Select all

PHP Fatal error:  Uncaught Exception: Error: EHLO not accepted from server!
My setting are:
Mail Engine: SMTP
Mail Parameters: [none]
SMTP Hostname: ssl://hostname
SMTP Password: [one used to successfully login to roundcube email]
SMTP Port: 465
SMTP Timeout: 10 (was originally 5)

I have also tried using tls://hostname with Port: 587 but the exact same error happens.

I spoke to my email host and they said everything is correct on their side, they said "The issue could be on the SMTP form or the PHP version you are using".

I would really appreciate your help with this matter.

Re: OC V3 PHP7.4 SMTP Issues: Error: EHLO not accepted from server!

Posted: Mon Apr 07, 2025 9:31 pm
by khnaz35
Your SMTP settings are incorrect.
You need to check the details again.

Re: OC V3 PHP7.4 SMTP Issues: Error: EHLO not accepted from server!

Posted: Tue Apr 08, 2025 12:08 am
by oursupersoftware
khnaz35 wrote:
Mon Apr 07, 2025 9:31 pm
Your SMTP settings are incorrect.
You need to check the details again.
I did confirm with them multiple times if the details they gave me are correct, and they said it is.

I'm so lost and now my business is not operational until this issue is resolved.

Is there any way I can disable all email sending until this issue is resolved, so I can at least continue trading?

Re: OC V3 PHP7.4 SMTP Issues: Error: EHLO not accepted from server!

Posted: Tue Apr 08, 2025 2:34 am
by nonnedelectari
you could change this code:

Code: Select all

throw new \Exception('Error: EHLO not accepted from server!');
in system/library/mail/smtp.php
to:

Code: Select all

throw new \Exception('Error: EHLO not accepted from server'."\n".'['.$reply.']');
so you get some more info as to what is returned from the EHLO command, if anything.

Re: OC V3 PHP7.4 SMTP Issues: Error: EHLO not accepted from server!

Posted: Tue Apr 08, 2025 3:50 am
by oursupersoftware
nonnedelectari wrote:
Tue Apr 08, 2025 2:34 am
you could change this code:

Code: Select all

throw new \Exception('Error: EHLO not accepted from server!');
in system/library/mail/smtp.php
to:

Code: Select all

throw new \Exception('Error: EHLO not accepted from server'."\n".'['.$reply.']');
so you get some more info as to what is returned from the EHLO command, if anything.
Thanks, this gave me a lot more context to what exactly the issue was so I can speak to my email hosting provider to sort out.

For those interested, the full error log is:

Code: Select all

PHP Fatal error:  Uncaught Exception: Error: EHLO not accepted from server! 550 Bad HELO - Host impersonating domain name [domainname.com]