Post by parkookk » Wed Oct 11, 2023 6:54 pm

Hi, as soon as I setup my SMTP mail correctly on my OC3038 I get this error:

Code: Select all

Fatal error: Uncaught Exception: Error: EHLO not accepted from server! in /system/library/mail/smtp.php:121 Stack trace: 
#0 /system/library/mail.php(142): Mail\Smtp->send() 
#1 /catalog/controller/information/contact.php(25): Mail->send() 
#2 /mediasos_storage/modification/system/engine/action.php(79): ControllerInformationContact->index() 
#3 /catalog/controller/startup/router.php(25): Action->execute(Object(Registry)) 
#4 /mediasos_storage/modification/system/engine/action.php(79): ControllerStartupRouter->index() 
#5 /system/engine/router.php(67): Action->execute(Object(Registry)) 
#6 /system/engine/router.php(56): Router->execute(Object(Action)) 
#7 /system/framework.php(169): Router->dis in /system/library/mail/smtp.php on line 121
And if user fill and submit the front-end contact page they see a 500 http error.
https://www.mediasos.co.uk/contact

I spoke to my hosting company and they said it's OC issue and I need to get in touch with you.

I have no mail extension on this OC.

Can someone help please?

ps, I can send and receive using the exactly the same smtp setting on my gmail accout, only the OC can't do it.
Last edited by parkookk on Wed Oct 11, 2023 7:59 pm, edited 1 time in total.

User avatar
Active Member

Posts

Joined
Thu Jan 17, 2013 11:56 pm
Location - london

Post by ADD Creative » Wed Oct 11, 2023 7:29 pm

What version of PHP? What mail settings are you using?

You can get more details of the error by changing line 121 in system/library/mail/smtp.php from.

Code: Select all

throw new \Exception('Error: EHLO not accepted from server!');
To.

Code: Select all

throw new \Exception('Error: EHLO not accepted from server! ' . $reply);

www.add-creative.co.uk


Guru Member

Posts

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

Post by parkookk » Wed Oct 11, 2023 7:41 pm

ADD Creative wrote:
Wed Oct 11, 2023 7:29 pm
What version of PHP? What mail settings are you using?

You can get more details of the error by changing line 121 in system/library/mail/smtp.php from.

Code: Select all

throw new \Exception('Error: EHLO not accepted from server!');
To.

Code: Select all

throw new \Exception('Error: EHLO not accepted from server! ' . $reply);
I use PHP 7.4 on SMTP mail setting of OC3038:

Mail Engine: SMTP
SMTP Hostname: my.hostname.co.uk (also used ssl://my.hostname.co.uk and had the same 500 error)
SMTP Username: my@email.address
SMTP Password: mypassword
SMTP Port: 465
SMTP Timeout: 5

After using your code I get this error:

Code: Select all

Fatal error: Uncaught Exception: Error: DATA not accepted from server! in /system/library/mail/smtp.php:241 
Stack trace: 
#0 /system/library/mail/smtp.php(209): Mail\Smtp->handleReply(Resource id #19, 250, 'Error: DATA not...') 
#1 /system/library/mail.php(142): Mail\Smtp->send() 
#2 /catalog/controller/information/contact.php(25): Mail->send() 
#3 /mediasos_storage/modification/system/engine/action.php(79): ControllerInformationContact->index() 
#4 /catalog/controller/startup/router.php(25): Action->execute(Object(Registry)) 
#5 /mediasos_storage/modification/system/engine/action.php(79): ControllerStartupRouter->index() 
#6 /system/engine/router.php(67): Action->execute(Object(Registry)) 
#7 in /system/library/mail/smtp.php on line 241
Last edited by parkookk on Wed Oct 11, 2023 8:05 pm, edited 3 times in total.

I am using English OpenCart 3.0.3.8, Default Template/Theme, php 7.4, Latest Brave Browser (No Ads-Blocker, etc.)


User avatar
Active Member

Posts

Joined
Thu Jan 17, 2013 11:56 pm
Location - london

Post by ADD Creative » Wed Oct 11, 2023 7:48 pm

You will need to use ssl://example.com with port 465 or tls://example.com with port 587. The timeout could also be a bit low. Try making the changes and see what errors you still get.

www.add-creative.co.uk


Guru Member

Posts

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

Post by parkookk » Wed Oct 11, 2023 8:07 pm

ADD Creative wrote:
Wed Oct 11, 2023 7:48 pm
You will need to use ssl://example.com with port 465 or tls://example.com with port 587. The timeout could also be a bit low. Try making the changes and see what errors you still get.
Thanks, I still get similar errors with ssl and tls port 465 and 587

I am using English OpenCart 3.0.3.8, Default Template/Theme, php 7.4, Latest Brave Browser (No Ads-Blocker, etc.)


User avatar
Active Member

Posts

Joined
Thu Jan 17, 2013 11:56 pm
Location - london

Post by ADD Creative » Wed Oct 11, 2023 8:18 pm

What error are you getting now "EHLO not accepted from server!" or DATA not accepted from server!?

For the latter change line 239 from.

Code: Select all

throw new \Exception($error_text);
To.

Code: Select all

throw new \Exception($error_text . $reply);
This will change the rrro text to show more information on why "DATA not accepted from server".

www.add-creative.co.uk


Guru Member

Posts

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

Post by parkookk » Wed Oct 11, 2023 8:37 pm

I tested it on OC3031 with PHP7.2 on the same host and it worked so why it's not working on OC3038 PHP7.4?
I use PHP 7.4 on SMTP mail setting of OC3038:

Mail Engine: SMTP
SMTP Hostname: ssl://my.hostname.co.uk
SMTP Username: my@email.address
SMTP Password: mypassword
SMTP Port: 465
SMTP Timeout: 5

I am using English OpenCart 3.0.3.8, Default Template/Theme, php 7.4, Latest Brave Browser (No Ads-Blocker, etc.)


User avatar
Active Member

Posts

Joined
Thu Jan 17, 2013 11:56 pm
Location - london

Post by parkookk » Wed Oct 11, 2023 8:45 pm

ADD Creative wrote:
Wed Oct 11, 2023 8:18 pm
What error are you getting now "EHLO not accepted from server!" or DATA not accepted from server!?

For the latter change line 239 from.

Code: Select all

throw new \Exception($error_text);
To.

Code: Select all

throw new \Exception($error_text . $reply);
This will change the rrro text to show more information on why "DATA not accepted from server".
Ok, here is the result error:

Code: Select all

Fatal error: Uncaught Exception: Error: DATA not accepted from server!550-Sorry! 
This server is unable to send email from this domain: 550 yahoo.co.uk. 
Please try sending from a domain on this server. 
in /home/..../system/library/mail/smtp.php:241 Stack trace: 
#0 /home/..../system/library/mail/smtp.php(209): Mail\Smtp->handleReply(Resource id #19, 250, 'Error: DATA not...') 
#1 /home/..../system/library/mail.php(142): Mail\Smtp->send() 
#2 /home/..../catalog/controller/information/contact.php(25): Mail->send() 
#3 /home/..../system/engine/action.php(79): ControllerInformationContact->index() 
#4 /home/..../catalog/controller/startup/router.php(25): Action->execute(Object(Registry)) 
#5 /home/..../storage/modification/system/engine/action.php(79): ControllerStartupRouter->index() 
#6 /home/public_ht in /home/..../system/library/mail/smtp.php on line 241

I am using English OpenCart 3.0.3.8, Default Template/Theme, php 7.4, Latest Brave Browser (No Ads-Blocker, etc.)


User avatar
Active Member

Posts

Joined
Thu Jan 17, 2013 11:56 pm
Location - london

Post by parkookk » Wed Oct 11, 2023 8:48 pm

very strange, I go to https://www.mediasos.co.uk/contact and fill the form with my personal email which is username@yahoo.co.uk and click submit, but why in the error it ask to try to send from another server than yahoo.co.uk?

Is it trying to change the server and use the end user's email address domain as the sending server?

I am using English OpenCart 3.0.3.8, Default Template/Theme, php 7.4, Latest Brave Browser (No Ads-Blocker, etc.)


User avatar
Active Member

Posts

Joined
Thu Jan 17, 2013 11:56 pm
Location - london

Post by parkookk » Wed Oct 11, 2023 9:27 pm

Ok, I have found the problem. In the contact form mediasos.co.uk/contact, if I use the same email address as the domain such as anything@mediasos.co.uk then email works but if I use anyemail@notmydomain.any then it gives that error.

I am using English OpenCart 3.0.3.8, Default Template/Theme, php 7.4, Latest Brave Browser (No Ads-Blocker, etc.)


User avatar
Active Member

Posts

Joined
Thu Jan 17, 2013 11:56 pm
Location - london

Guru Member

Posts

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

Post by parkookk » Thu Oct 12, 2023 5:42 pm

Thanks, it worked, your support brightens my day; I'm grateful for it.

I found another page here talking about replacing a few more lines, do you think I should change those too?
viewtopic.php?t=225890

So following your link, in the contact.php file I found:

Code: Select all

$mail->setFrom($this->request->post['email']);
and replaced it with:

Code: Select all

$mail->setFrom($this->config->get('config_email'));

I am using English OpenCart 3.0.3.8, Default Template/Theme, php 7.4, Latest Brave Browser (No Ads-Blocker, etc.)


User avatar
Active Member

Posts

Joined
Thu Jan 17, 2013 11:56 pm
Location - london

Post by ADD Creative » Thu Oct 12, 2023 10:07 pm

I would only change the setReplyTo if your host is still rejecting the mail. The setText change are just a matter preference, as to whether you want to see the customer's email in the mail body.

www.add-creative.co.uk


Guru Member

Posts

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

Users browsing this forum: No registered users and 1 guest