Post by Sportfreunde » Sun Jan 05, 2020 2:13 am

Hello everybody

I wanted to switch to SMTP instead of the PHP mail function in the Opencart Shop. Have made all the settings and also looked again in the Inet. But unfortunately I always get the error message after completing the order:

***********************************************

Code: Select all

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
OK
<br />
<b>Fatal error</b>: Uncaught Exception: Error: Connection refused (111) in /home/...../public_html/system/library/mail/smtp.php:90
Stack trace:
#0 /home/...../public_html/system/library/mail.php(142): Mail\Smtp-&gt;send()
#1 /home/...../public_html/catalog/controller/mail/order.php(275): Mail-&gt;send()
#2 /home/...../public_html/catalog/controller/mail/order.php(34): ControllerMailOrder-&gt;add(Array, '1', 'Bitte angezeigt...', true)
#3 /home/...../storage/modification/system/engine/action.php(79): ControllerMailOrder-&gt;index('checkout/order/...', Array)
#4 /home/...../public_html/system/engine/event.php(62): Action-&gt;execute(Object(Registry), Array)
#5 /home/...../storage/modification/system/engine/loader.php(232): Event-&gt;trigger('model/checkout/...', Array)
#6 /home/...../public_html/system/engine/proxy.php(47): Loader-&gt;{closure}(Array, Array)
#7 /home/...../public_html/catalog/controller/extension/payment/bank_transfer.php(23): Proxy-&gt;__call('addOrderHistory', Array)
#8 /ho in <b>/home/...../public_html/system/library/mail/smtp.php</b> on line <b>90</b><br />
***************************************************************************

It is actually filled in as described on: https://bit.ly/34J4gJz

This is the data from my mail host:
SMTP-Relay
Server : smtp.mailfence.com
User name : Username
Passwort : PW
Secure port : 465
Sicherheit : TLS/SSL
Authentifizierung : normal (PLAIN oder LOGIN)

Does anyone know why I always get these error messages? I have already asked my mail hoster. He says it's not up to you.
Last edited by straightlight on Wed Mar 04, 2020 8:08 pm, edited 1 time in total.
Reason: Added code tags.

New member

Posts

Joined
Sat Nov 30, 2019 4:46 am

Post by straightlight » Sun Jan 05, 2020 2:48 am

<b>Fatal error</b>: Uncaught Exception: Error: Connection refused (111)
Not an OC issue. Contact your host to obtain your SMTP info or follow your host's documentation. You could also test the SMTP email protocol by downloading an extension from the Marketplace; such as: PHPMailer.
Last edited by straightlight on Mon Jan 06, 2020 12:22 am, edited 1 time in total.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by letxobnav » Sun Jan 05, 2020 7:33 am

PHPMyAdmin to test SMTP?

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by straightlight » Mon Jan 06, 2020 12:21 am

letxobnav wrote:
Sun Jan 05, 2020 7:33 am
PHPMyAdmin to test SMTP?
PHPMailer. Post edited above.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Sportfreunde » Mon Jan 06, 2020 2:16 am

Thanks for your reply but I posted my SMTP data from my host below. So it's not because of the smtp data from my host. It's up to the shop because the mail doesn't go out at all. It should be possible today to send a simple SSL mail via Smtp. Why else is there this option.
Is there a free extension for sending SMTP? I definitely didn't find any.

New member

Posts

Joined
Sat Nov 30, 2019 4:46 am

Post by straightlight » Mon Jan 06, 2020 5:46 am

Is there a free extension for sending SMTP? I definitely didn't find any.
In the Marketplace, they're all paid extensions for PHPMailer, so far, when using the search. The costs are pretty low, however.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Sportfreunde » Tue Jan 07, 2020 1:39 am

Can someone tell me why there is the SMTP function but apparently not working?

New member

Posts

Joined
Sat Nov 30, 2019 4:46 am

Post by xxvirusxx » Tue Jan 07, 2020 1:41 am

Possible a bug when use SSL and SMTP

90% you SMTP work when you use port 26 (for unsecure)

viewtopic.php?f=201&t=215502

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by Sportfreunde » Tue Jan 07, 2020 2:58 am

You mean I think port 25 is really weird. Super modern shop but not able to send encrypted smtp messages. Very very funny

New member

Posts

Joined
Sat Nov 30, 2019 4:46 am

Post by sw!tch » Tue Jan 07, 2020 7:00 am

Sportfreunde wrote:
Tue Jan 07, 2020 2:58 am
Super modern shop
It's functional but not "super modern" compared to other MVC frameworks.

You can try going to the PHPMailer Github repo, they have a simple example posted right upfront.
https://github.com/PHPMailer/PHPMailer#a-simple-example

Temporarily setup that into a test sub-directory and see if mail is able to go out via SMTP. If you are able to send a test mail using that then you know its an issue with Opencart. PHPmailer returns much better error reporting and debugging, so you may get additional error information OC isn't reporting.

There are many factors and your web host is one of them. If you feel confident I would try the above, otherwise post in the commercial section for someone to help you.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by Sportfreunde » Thu Jan 09, 2020 3:43 am

Oh dear, it's not all that easy. I've done a lot on my own but I don't know if I can do it.

I think it is not difficult to intercept normal PHP.Mails or I am wrong.

What is the easiest way to send encrypted mail? It would be best if I received the delivery note on my mail when I placed an order. Then I can print it out and send the articles

New member

Posts

Joined
Sat Nov 30, 2019 4:46 am

Post by letxobnav » Thu Jan 09, 2020 12:07 pm

OC works just fine with no encryption, SSL and TLS (also ssl) mails on php mail and smtp.
1) If setup correct AND
2) if your mail server accepts it.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by xxvirusxx » Thu Jan 09, 2020 11:54 pm

With no encryption work...(non SSL/TLS) 3.x work, but doesn't work with SSL/TLS (465)

After testing 100% is a bug on 3.x.
Same settings on 2.3.0.2 SMPT work on 465, but doesn't work on 3.x.

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by letxobnav » Fri Jan 10, 2020 12:27 am

I use V3

Attachments

gmail-OCV3-Mailqueue.JPG

gmail-OCV3-Mailqueue.JPG (57.43 KiB) Viewed 4264 times

Last edited by letxobnav on Fri Jan 10, 2020 1:50 am, edited 1 time in total.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by Sportfreunde » Fri Jan 10, 2020 12:42 am

Okay then this is only possible via an extension. Can you recommend one for 3.x? I would like to run the mail traffic over ssl. Optionally, it would be great if you could also set that delivery notes should be sent directly to an email.

I don't find V3 that way. Is that, what?

Thanks for your help and patience

New member

Posts

Joined
Sat Nov 30, 2019 4:46 am

Post by letxobnav » Fri Jan 10, 2020 12:54 am

That extension added the possiblility to choose to use phpmailer class for more flexibility but also uses the very same smtp class from V3, that class has only been extended to provide full debug information and better error handling and reporting.

So I am not suggesting you need an extension, I only use the screenshot from that extension because it has the function to test all combinations of mail engine, class and port with a single click and provide an overview of the results so I can show you what works.

if I show you what works with my own isp, you will see that encrypted SMTP does not work as my isp only allows SMTP over port 25.

Attachments

test-mail-configurations.png

test-mail-configurations.png (39.84 KiB) Viewed 4270 times

Last edited by letxobnav on Fri Jan 10, 2020 1:45 am, edited 1 time in total.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by letxobnav » Fri Jan 10, 2020 1:42 am

it would be great if you could also set that delivery notes should be sent directly to an email.
not sure what you mean with delivery notes or what you mean by:
I don't find V3 that way. Is that, what?

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by straightlight » Fri Jan 10, 2020 3:44 am

Sportfreunde wrote:
Fri Jan 10, 2020 12:42 am
Okay then this is only possible via an extension. Can you recommend one for 3.x? I would like to run the mail traffic over ssl. Optionally, it would be great if you could also set that delivery notes should be sent directly to an email.

I don't find V3 that way. Is that, what?

Thanks for your help and patience
Already covered: viewtopic.php?f=199&t=215487#p773317

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Sportfreunde » Fri Feb 21, 2020 8:35 pm

I talked to the guys from Mail Manager

https://www.opencart.com/index.php?rout ... php%20mail

They tell me now that the mail client int will work after looking at the error message. I've been looking for a solution for so long. It shouldn't be a problem to send an SMTP mail in 2020.

What else could you try. I would like to send an SMTP SSL mail when ordering.

Ask for advice

New member

Posts

Joined
Sat Nov 30, 2019 4:46 am

Post by pprmkr » Fri Feb 21, 2020 8:42 pm

Server : tls://smtp.mailfence.com
Mail Parameters: -femailadres_sent_from

User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands
Who is online

Users browsing this forum: No registered users and 92 guests