Post by abdullahTR » Sun Jan 15, 2023 3:31 am

Hello.

I use opencart v3.0.3.2. I use the Journal 3 theme.

The contact form works, but I get an error like this on the payment screen and when updating the order status.

"SyntaxError: Unexpected teken '<' "<br />" <b>"... is not valid JSON parse error <br />
<b>Fatal error</b>: Uncaught Exception: Error: RCPT TO not accepted from server! 550 No such recipient here in/home/xxx/domains/xxxx/public_html/system/library/maiI/smtp.php:263"

Image

Smtp host name : tls://mail.xxxx.com
Smtp port : 587
Smtp time : 5

I reinstalled the original smtp.php file to see if there was an error in the installation and nothing changed. When I requested support from my server company, they said that there was no problem.

Can you help me?

New member

Posts

Joined
Tue May 12, 2020 8:44 pm

Post by JNeuhoff » Sun Jan 15, 2023 7:13 am

You have posted the same issue on multiple forum threads now, see the replies to your other threads.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by ADD Creative » Sun Jan 15, 2023 8:16 am

You mail provider is rejecting the to address. Maybe there is something wrong with the customer email address, such as a special character or whitespace.

Also looks like your error display settings are wrong.

You need make sure display errors in set to off in all 3 places. Your PHP settings, in system/config/default.php and in the settings. Not only can this cause minor notices and warnings to cause bigger errors, it can also be a security risk.

1. In your PHP settings make sure display_errors is set to Off. Use phpinfo() to check. It should be off by default, but there are lots of rubbish hosts out there.

2. In system/config/default.php set error_display to false.

3. In your OpenCart Setting on the server tab set Display Errors to No.

www.add-creative.co.uk


Guru Member

Posts

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

Post by khnaz35 » Sun Jan 15, 2023 9:34 am

check if the email settings are correct.
Check if the email address being use for the order creation is valid.

Got an urgent question that’s keeping you up at night? There might just be a magical inbox ready to help: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by abdullahTR » Mon Jan 16, 2023 3:06 pm

ADD Creative wrote:
Sun Jan 15, 2023 8:16 am
You mail provider is rejecting the to address. Maybe there is something wrong with the customer email address, such as a special character or whitespace.

Also looks like your error display settings are wrong.

You need make sure display errors in set to off in all 3 places. Your PHP settings, in system/config/default.php and in the settings. Not only can this cause minor notices and warnings to cause bigger errors, it can also be a security risk.

1. In your PHP settings make sure display_errors is set to Off. Use phpinfo() to check. It should be off by default, but there are lots of rubbish hosts out there.

2. In system/config/default.php set error_display to false.

3. In your OpenCart Setting on the server tab set Display Errors to No.
khnaz35 wrote:
Sun Jan 15, 2023 9:34 am
check if the email settings are correct.
Check if the email address being use for the order creation is valid.
Thank you for your responses. Such an error occurs due to the customer's e-mail address.

New member

Posts

Joined
Tue May 12, 2020 8:44 pm

Post by khnaz35 » Mon Jan 16, 2023 3:41 pm

Am glad this issue is resolved now!
You can simply word [SOLVED] in the topic header.

Got an urgent question that’s keeping you up at night? There might just be a magical inbox ready to help: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by Mike Guenther » Thu Feb 29, 2024 10:24 pm

I have the exact same problem. I use SMTP, settings are correct. Is there a way to allow the order to complete and the email obviously gets bounced? Right now, if a customer tries to submit the order with an incorrect email or one that doesn't exist - the checkout page will just spin...BUT the card WILL get charged. But the order does not complete, and it goes to missing orders.

If the customer tries to keep pushing the order through, the same thing will happen over and over, and the card will continue to get charged. a big pain.

I am using OC version 3.0.3.8. I found this, but I am unsure if it would help my situation or not:

https://hosting.xyz/wiki/hosting/cms/op ... ,Attention!

Any help would be appreciated.

Active Member

Posts

Joined
Thu Oct 13, 2011 12:00 am

Post by ADD Creative » Thu Feb 29, 2024 10:47 pm

Mike Guenther wrote:
Thu Feb 29, 2024 10:24 pm
I have the exact same problem. I use SMTP, settings are correct. Is there a way to allow the order to complete and the email obviously gets bounced? Right now, if a customer tries to submit the order with an incorrect email or one that doesn't exist - the checkout page will just spin...BUT the card WILL get charged. But the order does not complete, and it goes to missing orders.

If the customer tries to keep pushing the order through, the same thing will happen over and over, and the card will continue to get charged. a big pain.

I am using OC version 3.0.3.8. I found this, but I am unsure if it would help my situation or not:

https://hosting.xyz/wiki/hosting/cms/opencart/issues/rcpt-to-not-accepted/#:~:text=Error%20%22RCPT%20TO%20not%20accepted,Attention!

Any help would be appreciated.
Yes check that the email you set in your admin is the same as the one for the SMTP account.

If that doesn't help you have a couple options. First use Mail as the setting for Mail Engine in the OpenCart settings. Not all hosts configure PHP mail correctly so may not work of give other issues. If you do switch use an online email deliverability checker such as mail-tester.com to test everthing is set up correctly.

Another option would be to modify system/library/mail/smtp.php and replace the throw new \Exception errors with trigger_error followed by a return.

www.add-creative.co.uk


Guru Member

Posts

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

Post by Mike Guenther » Thu Feb 29, 2024 11:55 pm

Thank you for the reply! I tried to use the built in mail function-but it seemed to get blocked a ton or just not get delivered.

I'd love to try your suggestion of: "Another option would be to modify system/library/mail/smtp.php and replace the throw new \Exception errors with trigger_error followed by a return." How exactly do I do that? What is the code I need to replace and with what?

Active Member

Posts

Joined
Thu Oct 13, 2011 12:00 am

Post by ADD Creative » Fri Mar 01, 2024 1:29 am

Mike Guenther wrote:
Thu Feb 29, 2024 11:55 pm
Thank you for the reply! I tried to use the built in mail function-but it seemed to get blocked a ton or just not get delivered.

I'd love to try your suggestion of: "Another option would be to modify system/library/mail/smtp.php and replace the throw new \Exception errors with trigger_error followed by a return." How exactly do I do that? What is the code I need to replace and with what?
In system/library/mail/smtp.php find lines such as.

Code: Select all

throw new \Exception('Error: ...');
And replace with

Code: Select all

trigger_error('Error: ...');
fclose($handle);
return;
Another option would be to add a try catch around the send in system/library/mail.php.

www.add-creative.co.uk


Guru Member

Posts

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

Post by JNeuhoff » Fri Mar 01, 2024 1:31 am

I use this simple VQmod XML bugfix for this:

Code: Select all

<modification>
	<id>Bugfix: Mail Send</id>
	<version>3.0.x-1.0</version>
	<vqmver>2.5.1</vqmver>
	<author>mhccorp.com</author>

	<file name="system/library/mail.php">
		<operation>
			<search position="replace"><![CDATA[$this->adaptor->send();]]></search>
			<add><![CDATA[
		try {
			$this->adaptor->send();
		} catch (Exception $e) {
			$msg = $e->getMessage();
			error_log(date('Y-m-d G:i:s')." - "."Mail::send: Unable to send to '".$this->to."', got this error: '$msg'\n",3,DIR_LOGS."mail.log");
		}
			]]></add>
		</operation>
	</file>

</modification>

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Mike Guenther » Fri Mar 01, 2024 1:37 am

Thank you both ADD Creative and JNeuhoff! I'd like to try the VQMod, looks easier that replacing several instances of code. Do I just copy all of that, save as an XML and upload it?

And since it's the mail file, it only affects using the Mail method and not the SMTP? Is that correct? I'd prefer using the SMTP.
Last edited by Mike Guenther on Fri Mar 01, 2024 1:57 am, edited 1 time in total.

Active Member

Posts

Joined
Thu Oct 13, 2011 12:00 am

Post by JNeuhoff » Fri Mar 01, 2024 1:56 am

You'd need a VQmod engine itself, too. Or, just rewrite it as an OCmod XML script, it's only a single search/replace.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Mike Guenther » Fri Mar 01, 2024 1:59 am

OK, how do I: "just rewrite it as an OCmod XML script, it's only a single search/replace."

And since it's the mail file, it only affects using the Mail method and not the SMTP? Is that correct? I'd prefer using the SMTP.

I am happy to pay for an extension or mod as well.

Active Member

Posts

Joined
Thu Oct 13, 2011 12:00 am

Post by paulfeakins » Fri Mar 01, 2024 8:40 pm

Mike Guenther wrote:
Fri Mar 01, 2024 1:59 am
I am happy to pay for an extension or mod as well.
If you can't find an extension, you could pay a developer such as ourselves or post a job in the Commercial Support Forum.

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 Mike Guenther » Fri Mar 01, 2024 9:00 pm

Thank you. I just requested a quote.

Active Member

Posts

Joined
Thu Oct 13, 2011 12:00 am

Post by JNeuhoff » Fri Mar 01, 2024 10:04 pm

Mike Guenther wrote:
Fri Mar 01, 2024 1:59 am
OK, how do I: "just rewrite it as an OCmod XML script, it's only a single search/replace."

And since it's the mail file, it only affects using the Mail method and not the SMTP? Is that correct? I'd prefer using the SMTP.

I am happy to pay for an extension or mod as well.
Below is the same modification written up as a OCmod XML script:

Code: Select all

<modification>
	<name>Bugfix: Mail Send</name>
	<code>Bugfix: Mail Send</code>
	<version>3.0.x-1.0</version>
	<author>MHC Web Design</author>
	<link>https://www.mhccorp.com</link>

	<file path="system/library/mail.php">
		<operation>
			<search><![CDATA[$this->adaptor->send();]]></search>
			<add position="replace"><![CDATA[
		try {
			$this->adaptor->send();
		} catch (Exception $e) {
			$msg = $e->getMessage();
			error_log(date('Y-m-d G:i:s')." - "."Mail::send: Unable to send to '".$this->to."', got this error: '$msg'\n",3,DIR_LOGS."mail.log");
		}
			]]></add>
		</operation>
	</file>

</modification>
Just upload it via FTP to system/bugfix-mail-send.ocmod.xml and refresh your OCmod at Extensions > Modifications via your admin backend.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Mike Guenther » Fri Mar 01, 2024 11:05 pm

I uploaded it via FTP and refreshed the Modifications but I do not see the script anywhere? Having said that, I did a test order with a bad email and the order still went through! Thanks so much! I love OC!

Active Member

Posts

Joined
Thu Oct 13, 2011 12:00 am

Post by jrr » Sat Mar 09, 2024 12:06 am

Mike Guenther wrote:
Fri Mar 01, 2024 11:05 pm
I uploaded it via FTP and refreshed the Modifications but I do not see the script anywhere? Having said that, I did a test order with a bad email and the order still went through! Thanks so much! I love OC!
Check Admin/Extensions/Modifications/Modification List - Log and you should see something like:
2024-03-07 22:33:36 - MOD: Modification Default

FILE: system/engine/action.php
REGEX: ~(require|include)(_once)?\(([^)]+)~
LINE: 69

FILE: system/engine/loader.php
REGEX: ~(require|include)(_once)?\(([^)]+)~
LINE: 77
LINE: 151
LINE: 168

FILE: system/library/config.php
REGEX: ~(require|include)(_once)?\(([^)]+)~
LINE: 59

FILE: system/library/language.php
REGEX: ~(require|include)(_once)?\(([^)]+)~
LINE: 67
LINE: 73

FILE: system/library/template/template.php
REGEX: ~(require|include)(_once)?\(([^)]+)~
LINE: 18
----------------------------------------------------------------
MOD: Bugfix: Mail Send
John :-#)#

jrr
Active Member

Posts

Joined
Mon Nov 20, 2017 1:48 pm

Post by Mike Guenther » Sat Mar 09, 2024 12:22 am

Yes, I see it now! Thanks so much!

Active Member

Posts

Joined
Thu Oct 13, 2011 12:00 am
Who is online

Users browsing this forum: No registered users and 47 guests