Post by vourlismenos » Fri Feb 09, 2024 3:26 am

I have a 2.1.0.1 oc website.
Recently we moved our email hosting from our webhosting, to a third party (hostinger) in order to have more space and to use imap efficiently.

I just realised that after this move, the contact form of the website (and only the contact form) has some problems.
The protocol in the website is "Mail".
The contact form seems to be working fine - user gets the success message etc, but we never receive the email.
There is no error in the log. Every other email function of the website works just fine.

I tried switching to smtp.
All email functions (contact form, remind password, etc) stopped working. We get a blank page instead of success and the error: Notice: Error: EHLO not accepted from server!

Added ssl:// in front of the hostname and everything works except from the contact form. Instead of success message we get a blank page and the error: PHP Notice: Error: RCPT TO not accepted from server!

From what I see there are loads of similar threds, posts, solutions all over the forums and google.
Nothing I tried, seems to work.

The email settings are correct, as provided by the email hosting company and used everywhere else.

Any ideas what might be happening?
Thank you

Newbie

Posts

Joined
Wed Dec 05, 2018 5:01 pm

Post by ADD Creative » Fri Feb 09, 2024 5:42 pm

For Mail, your server is probably still sending locally. If using cPanel setting Remote Mail Exchanger in the Email Routing may help. But use an online email deliverability checker to check everything is configured correctly.

For SMTP and possibly Mail. The version of OpenCart is probably trying to seed a email from the contact form filler's address, which any decent mail server would block. Try the change at. https://github.com/opencart/opencart/co ... 2f7903601e

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by vourlismenos » Fri Feb 09, 2024 9:10 pm

I found a solution very similar to the one you've sent.

Code: Select all

//$mail->setFrom($this->request->post['email']);
$mail->setFrom($this->config->get('config_email'));
//$mail->setSender(html_entity_decode($this->request->post['name'], ENT_QUOTES, 'UTF-8'));
$mail->setSender($this->request->post['email']);
They both seem to work, but not without an extra change in system/library/mail.php that I found here: https://hosting.xyz/wiki/hosting/cms/op ... -accepted/

as far as I can see not all changes are needed.
I just had to change in #315

Code: Select all

//fputs($handle, 'MAIL FROM: <' . $this->from . '>' . "\r\n");
fputs($handle, 'MAIL FROM: <' . $this->user_name . '>' . "\r\n");
It seems to work fine now ???

Newbie

Posts

Joined
Wed Dec 05, 2018 5:01 pm

Post by paulfeakins » Sat Feb 10, 2024 12:52 am

vourlismenos wrote:
Fri Feb 09, 2024 9:10 pm
It seems to work fine now ???
If it's still good in a few days, please add [SOLVED] to the start of this topic title.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by vourlismenos » Sat Feb 10, 2024 12:56 am

I will, still testing it!

Newbie

Posts

Joined
Wed Dec 05, 2018 5:01 pm

Post by ADD Creative » Sat Feb 10, 2024 8:03 am

vourlismenos wrote:
Fri Feb 09, 2024 9:10 pm
I found a solution very similar to the one you've sent.

Code: Select all

//$mail->setFrom($this->request->post['email']);
$mail->setFrom($this->config->get('config_email'));
//$mail->setSender(html_entity_decode($this->request->post['name'], ENT_QUOTES, 'UTF-8'));
$mail->setSender($this->request->post['email']);
They both seem to work, but not without an extra change in system/library/mail.php that I found here: https://hosting.xyz/wiki/hosting/cms/op ... -accepted/

as far as I can see not all changes are needed.
I just had to change in #315

Code: Select all

//fputs($handle, 'MAIL FROM: <' . $this->from . '>' . "\r\n");
fputs($handle, 'MAIL FROM: <' . $this->user_name . '>' . "\r\n");
It seems to work fine now ???
That change is fine as long as your SMTP username is an email address. If you ever changed providers it may break things.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by vourlismenos » Sat Feb 10, 2024 6:12 pm

ADD Creative wrote:
Sat Feb 10, 2024 8:03 am
That change is fine as long as your SMTP username is an email address. If you ever changed providers it may break things.
True.
Even though all provides (so far) used the email as a username, I think the right way is to avoid that.

Newbie

Posts

Joined
Wed Dec 05, 2018 5:01 pm
Who is online

Users browsing this forum: No registered users and 58 guests