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
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
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
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
I found a solution very similar to the one you've sent.
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
It seems to work fine now 
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']);
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");

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
That change is fine as long as your SMTP username is an email address. If you ever changed providers it may break things.vourlismenos wrote: ↑Fri Feb 09, 2024 9:10 pmI found a solution very similar to the one you've sent.
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/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']);
as far as I can see not all changes are needed.
I just had to change in #315
It seems to work fine nowCode: Select all
//fputs($handle, 'MAIL FROM: <' . $this->from . '>' . "\r\n"); fputs($handle, 'MAIL FROM: <' . $this->user_name . '>' . "\r\n");
![]()
True.ADD Creative wrote: ↑Sat Feb 10, 2024 8:03 amThat change is fine as long as your SMTP username is an email address. If you ever changed providers it may break things.
Even though all provides (so far) used the email as a username, I think the right way is to avoid that.
Who is online
Users browsing this forum: No registered users and 58 guests