Post by RideTheWave » Thu Dec 03, 2020 6:01 am

Sometimes my outgoing mail is very slow to send. Sometimes it could take a few minutes before the email sends. This is likely an issue with the host. Whenever this happens, automated order confirmation emails sent to a customer after a purchase don't get sent. The emails sent to a customer after an order status update also don't get sent (we get an "Internal Server Error" in the admin page). So I was wondering if there was a setting in OpenCart that allowed the site to wait longer for emails to be sent before giving that error (ie/ extend the timeout period). I'm using OpenCart 2.3.0.2. Does anyone know if such a setting exists?

New member

Posts

Joined
Fri May 19, 2017 8:29 am

Post by ADD Creative » Thu Dec 03, 2020 6:14 am

Assuming you are using SMTP as the Mail Protocol in the OpenCart Mail settings. Have you tried increasing the SMTP Timeout value in the OpenCart Mail?settings?

Have you tried using Mail as the Mail Protocol in the OpenCart Mail settings?

www.add-creative.co.uk


Guru Member

Posts

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

Post by RideTheWave » Thu Dec 03, 2020 6:22 am

I'm using SMTP in the mail protocol setting. I see the SMTP Timeout, it's currently set to 7. Is that in seconds? What is the recommend value this should be and what value should it be if I have a slow sending email?

New member

Posts

Joined
Fri May 19, 2017 8:29 am

Post by RideTheWave » Thu Dec 03, 2020 6:56 am

ADD Creative wrote:
Thu Dec 03, 2020 6:14 am
Assuming you are using SMTP as the Mail Protocol in the OpenCart Mail settings. Have you tried increasing the SMTP Timeout value in the OpenCart Mail?settings?

Have you tried using Mail as the Mail Protocol in the OpenCart Mail settings?
By the way, what's the difference between using Mail and SMTP in the mail protocol setting?

New member

Posts

Joined
Fri May 19, 2017 8:29 am

Post by ADD Creative » Thu Dec 03, 2020 8:16 am

RideTheWave wrote:
Thu Dec 03, 2020 6:22 am
I'm using SMTP in the mail protocol setting. I see the SMTP Timeout, it's currently set to 7. Is that in seconds? What is the recommend value this should be and what value should it be if I have a slow sending email?
Yes, it's in seconds, I think the default is 5. You won't want it too big as it will delay the resulting page displaying. Also you probably don't want it bigger than your PHP max_execution_time setting.
RideTheWave wrote:
Thu Dec 03, 2020 6:56 am
By the way, what's the difference between using Mail and SMTP in the mail protocol setting?
Mail will use the PHP mail function. This will likely be configured to send to the servers MTA (mail transfer agent). Mail is likely to be quicker as it's not likely to have to wait. The MTA will do that part. However, if not configure correctly it could increase the chance the email will be classed as spam.
https://www.php.net/manual/en/function.mail.php

SMTP will use OpenCart's SMTP class to send to the mail server in the SMTP Hostname setting, using the SMTP protocol.

www.add-creative.co.uk


Guru Member

Posts

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

Post by RideTheWave » Thu Dec 03, 2020 8:38 am

In my php.ini file, the max_execution_time is set to 36000. Is that also in seconds, and if so isn't that a pretty high value? I don't remember changing this, is that the default value?

New member

Posts

Joined
Fri May 19, 2017 8:29 am

Post by ADD Creative » Thu Dec 03, 2020 10:53 am

RideTheWave wrote:
Thu Dec 03, 2020 8:38 am
In my php.ini file, the max_execution_time is set to 36000. Is that also in seconds, and if so isn't that a pretty high value? I don't remember changing this, is that the default value?
Yes that is also in seconds. The default is 30, but different host will set different defaults.

www.add-creative.co.uk


Guru Member

Posts

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

Post by paulfeakins » Thu Dec 03, 2020 7:26 pm

RideTheWave wrote:
Thu Dec 03, 2020 8:38 am
In my php.ini file, the max_execution_time is set to 36000. Is that also in seconds, and if so isn't that a pretty high value? I don't remember changing this, is that the default value?
That's too high. If a certain script requires a high timeout like that it should set it itself. Otherwise you risk threads crashing and not being killed off quickly enough.

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 OSWorX » Sat Dec 05, 2020 4:45 pm

RideTheWave wrote:
Thu Dec 03, 2020 6:56 am
By the way, what's the difference between using Mail and SMTP in the mail protocol setting?
Using the native php mail is the most worst decision one can make.
Why?
Because no security and anything else is used.

That's why SMTP should be used.
And here the domain own mailserver.
Why?
Because here you can define some very important settings like SPAM, Virusscanner, DKIM, SPDIF and so on.
And it the all are set correct, you can be sure that your emails will be delivered.
And receiving them means also they have tp pass all security settings successfully.

I see some store owners using GMail as their "mail provider".
Now assume you are the customer and you order in the store "supadupastore.com"
And you receive an email from the iamthebest @ gmail.com

What do you think now?
Are you confident with that sender?
Can this really be trusted - because the email comes from an gmail account?

Many fake shops are working this way - so avoid to use gmail as the mail provider!

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by RideTheWave » Tue Dec 29, 2020 9:59 am

ADD Creative wrote:
Thu Dec 03, 2020 8:16 am
RideTheWave wrote:
Thu Dec 03, 2020 6:56 am
By the way, what's the difference between using Mail and SMTP in the mail protocol setting?
Mail will use the PHP mail function. This will likely be configured to send to the servers MTA (mail transfer agent). Mail is likely to be quicker as it's not likely to have to wait. The MTA will do that part. However, if not configure correctly it could increase the chance the email will be classed as spam.
https://www.php.net/manual/en/function.mail.php
SMTP will use OpenCart's SMTP class to send to the mail server in the SMTP Hostname setting, using the SMTP protocol.
If I wanted to switch to using Mail instead of SMTP, is it simply a matter of just selecting "Mail" in the dropdown menu of "Mail Protocol" in the store settings? Do I have to specify my return email address somewhere else?

Beneath "Mail Protocol" is "Mail Parameters." That's currently blank. Do I have to add anything there in order to use the "Mail" protocol?

New member

Posts

Joined
Fri May 19, 2017 8:29 am

Post by by mona » Tue Dec 29, 2020 11:02 am


DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by straightlight » Tue Dec 29, 2020 1:04 pm

The OP user uses SMTP. The presented video shows how to setup mail protocol only near the end.

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 by mona » Tue Dec 29, 2020 1:27 pm

and at the very end of the video there is how to set up multiple admin emails
and below the video is a screenshot for the mail settings
Happy Holidays


PS to the right there is a full menu of basic set up instructions :)
and as a pre-emptive measure ..
viewtopic.php?t=44115

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by straightlight » Tue Dec 29, 2020 8:14 pm

Mail protocol is not safe. SMTP with TLS / SSL is rather recommended.

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 by mona » Tue Dec 29, 2020 10:37 pm

@straightlight - yes agreed
OSWorX wrote:
Sat Dec 05, 2020 4:45 pm
RideTheWave wrote:
Thu Dec 03, 2020 6:56 am
By the way, what's the difference between using Mail and SMTP in the mail protocol setting?
Using the native php mail is the most worst decision one can make.
Why?
Because no security and anything else is used.

That's why SMTP should be used.
And here the domain own mailserver.
Why?
Because here you can define some very important settings like SPAM, Virusscanner, DKIM, SPDIF and so on.
And it the all are set correct, you can be sure that your emails will be delivered.
And receiving them means also they have tp pass all security settings successfully.
This is good advice. My original post was carefully selected.
It both answers the OPs subsequent question and guides others searching the forum how to follow the good advice.
Win win ..

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by ADD Creative » Wed Dec 30, 2020 2:28 am

RideTheWave wrote:
Tue Dec 29, 2020 9:59 am
If I wanted to switch to using Mail instead of SMTP, is it simply a matter of just selecting "Mail" in the dropdown menu of "Mail Protocol" in the store settings? Do I have to specify my return email address somewhere else?

Beneath "Mail Protocol" is "Mail Parameters." That's currently blank. Do I have to add anything there in order to use the "Mail" protocol?
Yes, just select Mail as the "Mail Protocol". You can usually set the return address in the "Mail Parameters" by prefixing with -f. So if your email was test@example.com enter.

Code: Select all

-ftest@example.com

www.add-creative.co.uk


Guru Member

Posts

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

Post by by mona » Wed Dec 30, 2020 3:24 am

If I may

The return address is usually taken from the email address set in the store tab in the settings section of admin.

However there are occasions when the parameter -f is required and sometimes it needs to be a capital letter -F and sometimes there requires a space between the -f or the -F and the subsequent email address i.e. -f mymail@mail dot xxx

by mona wrote:
Tue Dec 29, 2020 1:27 pm
viewtopic.php?t=44115
As a disclaimer, it is not advisable for security reasons to use the mail parameter and you should use smtp whenever possible.

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by RideTheWave » Wed Dec 30, 2020 10:25 am

straightlight wrote:
Tue Dec 29, 2020 8:14 pm
Mail protocol is not safe. SMTP with TLS / SSL is rather recommended.
When you say Mail protocol is not safe, what are some examples of harmful things that could happen? Does it make the site more prone to being hacked or is it a matter of the actual emails getting hacked?

So do I have to put my email address in the Mail Parameters section or can I leave that blank? If the return address is automatically the email address you put in the Store settings, what's the purpose of Mail Parameters?

New member

Posts

Joined
Fri May 19, 2017 8:29 am

Post by straightlight » Wed Dec 30, 2020 10:48 am

RideTheWave wrote:
Wed Dec 30, 2020 10:25 am
straightlight wrote:
Tue Dec 29, 2020 8:14 pm
Mail protocol is not safe. SMTP with TLS / SSL is rather recommended.
When you say Mail protocol is not safe, what are some examples of harmful things that could happen? Does it make the site more prone to being hacked or is it a matter of the actual emails getting hacked?

So do I have to put my email address in the Mail Parameters section or can I leave that blank? If the return address is automatically the email address you put in the Store settings, what's the purpose of Mail Parameters?
Google:
From my experience, most users prefer SMTP to PHP, as PHP tends to have longer delays in mail sending via forms. SMTP works a lot smoother and PHP forms are not as secure. I also had the experience of using PHPmailer depending on the hoster's architecture.
As for the SMTP configuration, login to your cPanel > Emails > <Your Email > > Settings > Lower-left side (SSL). See your host's configuration.

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 ADD Creative » Fri Jan 01, 2021 5:42 am

RideTheWave wrote:
Wed Dec 30, 2020 10:25 am
When you say Mail protocol is not safe, what are some examples of harmful things that could happen? Does it make the site more prone to being hacked or is it a matter of the actual emails getting hacked?

So do I have to put my email address in the Mail Parameters section or can I leave that blank? If the return address is automatically the email address you put in the Store settings, what's the purpose of Mail Parameters?
You can leave it blank, but it will then probably use the your hosting default mail account and not the address you set in OpenCart. It depends on how your hosting is set up.

As for security, it again depends on how your hosting is set up. If set correctly the PHP mail will likely be sending directly to the same local MTA program that receives email via SMTP.

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: Bing [Bot] and 28 guests