Post by matthewbaynham » Sat Mar 06, 2021 4:16 pm

Opencart 3.0.3.2

My installation of opencart can't email. I don't know have any idea where to look, I don't have a detailed error message it just isn't working.

I know Opencart can send emails in different ways either:
  • when someone fills in the contact form and clicks send
  • when I'm in the admin part and I go to Marketing -> Mail
  • when someone is trying to buy goods and register themselves as a customer (I would guess it sends a email to confirm identity to activate, I was testing this when I noticed the problem).
Which ever way of sending emails they all don't work and I don't get an error message.

When I look at the settings for email I go to System -> Settings I click the edit button on my store and I got to the Mail tab. I enter those exact details into an email client and it works perfectly well, no problems at all.

Any ideas?

Attachments

Screenshot from 2021-03-06 09-07-54.png

Screenshot from 2021-03-06 09-07-54.png (93.54 KiB) Viewed 932 times


New member

Posts

Joined
Fri Nov 01, 2019 9:18 pm

Post by sw!tch » Sat Mar 06, 2021 5:23 pm

Check your PHP server error log. Ensure you have proper SPF and DKIM records setup.

Reach out to your web host and explain the issue.

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 matthewbaynham » Sun Mar 07, 2021 5:27 am

I couldn't see anything in my PHP server error log.

Tomorrow I'll have to read about having the proper SPF and DKIM records setup.

However I just had a thought, Opencart is not thing only thing I have on the server, I have GLPI going all the customer support https://glpi-project.org This GLPI is on the same LAMP as the Opencart and so it uses the same PHP. And my GLPI installation can send emails perfectly fine.

So GLPI can send emails but Opencart can't.

So if GLPI works do I still need to check the setup of the PHP and the setup of the SPF and the DKIM?

Surely the GLPI narrows down the problem to it being a Opencart issue?

Or are there different way that emails can be sent and Opencart just does things different?

Any thoughts?

New member

Posts

Joined
Fri Nov 01, 2019 9:18 pm

Post by mikeinterserv » Sun Mar 07, 2021 5:37 am

You can try in smtp hostname
SSL://smtp.strato.de
If your using smtp for glpi then look at those settings, may give you a clue

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by ADD Creative » Sun Mar 07, 2021 5:44 am

matthewbaynham wrote:
Sun Mar 07, 2021 5:27 am
So if GLPI works do I still need to check the setup of the PHP and the setup of the SPF and the DKIM?

Surely the GLPI narrows down the problem to it being a Opencart issue?

Or are there different way that emails can be sent and Opencart just does things different?

Any thoughts?
Your settings look wrong. If using port 465 you need to add ssl:// in front of your SMTP Hostname. You still need to check SPF and the DKIM as these help to avoid your emails being treated as spam. Use an online email deliverability checker to check them.

www.add-creative.co.uk


Expert Member

Posts

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

Post by rahuljain1991 » Sun Mar 07, 2021 6:34 pm

Hi

Try ssl://mail.yourhostname

some host doesn't allow email in the username as i just configure the same issue for someone yesterday. they were probably using bigrock
the username can be noted from smtp settings from cpanel.

Rahul Jain
IT Support - always available to help
My Opencart Extensions
Authentic IT Services - Web design and development
AIS MarketPlace


New member

Posts

Joined
Thu Nov 16, 2017 1:39 am


Post by matthewbaynham » Mon Mar 08, 2021 2:44 am

Now things are strange.

I've go it so that Opencart can now send emails send emails.

However it's configured to send them from the address noreply@gwenllian-retail.com and it actually send's them from contact@gwenllian-retail.com

And the emails are not encrypted. So when the email appears in my gmail inbox there is a little red icon of an open padlock with the warning "gwellian-retail.com did not encrypt this message Learn more" (This is despite using the SSL in "SSL://smtp.strato.de")

As I mention above I've got GLPI installed on my LAMP and that emails OK. This GLPI is suppose to send emails from contact@gwenllian-retail.com and it does correctly send it's emails from contact@gwenllian-retail.com and GLPI uses TLS encryption. So GLPI is doing things correctly.

So what part of Opencart makes sure that the emails are encrypted?

And if the email is configured to be send from one mailbox and comes from a different mailbox then what should I look at to fix this?

Any ideas or any clues?

New member

Posts

Joined
Fri Nov 01, 2019 9:18 pm

Post by mikeinterserv » Mon Mar 08, 2021 3:07 am

What is your store admin email
What is the email you set in smtp settings - they appear to not be the same
Also the mail parameters where you have your reply address are only applicable to php mail NOT smtp
If gpli is happy with tls then try port 465 first if no luck then 587 TLS:// instead of 465 SSL://
What are the settings you have for glpi

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by ADD Creative » Mon Mar 08, 2021 4:14 am

matthewbaynham wrote:
Mon Mar 08, 2021 2:44 am
Now things are strange.

I've go it so that Opencart can now send emails send emails.

However it's configured to send them from the address noreply@gwenllian-retail.com and it actually send's them from contact@gwenllian-retail.com

And the emails are not encrypted. So when the email appears in my gmail inbox there is a little red icon of an open padlock with the warning "gwellian-retail.com did not encrypt this message Learn more" (This is despite using the SSL in "SSL://smtp.strato.de")

As I mention above I've got GLPI installed on my LAMP and that emails OK. This GLPI is suppose to send emails from contact@gwenllian-retail.com and it does correctly send it's emails from contact@gwenllian-retail.com and GLPI uses TLS encryption. So GLPI is doing things correctly.

So what part of Opencart makes sure that the emails are encrypted?

And if the email is configured to be send from one mailbox and comes from a different mailbox then what should I look at to fix this?

Any ideas or any clues?
The ssl:// prefix ensures that emails are sent over a secure connection. Note ssl (and tls) should be lower case. The exact encryption protocol depends on your PHP version. What version of PHP are you using?

Maybe GLPI is using the PHP mail function. Have you tried Mail and the Mail Engine in the OpenCart settings?

www.add-creative.co.uk


Expert Member

Posts

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

Post by matthewbaynham » Mon Mar 08, 2021 6:36 am

My server has PHP Version 7.2.34-18+ubuntu18.04.1+deb.sury.org+1

Also I don't understand what you mean by "Have you tried Mail and the Mail Engine in the OpenCart settings?" in the original post of this treat I put a screenshot of my mail settings in opencart and the only thing I've changed is the "ssl://" prefix in front of the hostname. Is that what you're referring to?

Also in my php.ini file do I need to set the openssl.cafile and openssl.capath? Because the comments around those settings say "Most users should not specify a value for this directive as PHP will attempt to use the OS-managed cert stores in its absence."

New member

Posts

Joined
Fri Nov 01, 2019 9:18 pm

Post by mikeinterserv » Mon Mar 08, 2021 6:56 am

Well GLPi uses php mail or smtp just like opencart
What is the problem in looking at the settings in GLPi

Next there are 2 methods of sending mail in opencart. php mail and smtp
If you use php mail you leave the smtp settings default and choose mail engine MAIL not smtp

You shouldn't need to touch your php ini file - GLPi is working fine you said.
Also you said GLPi worked fine with tls so why haven't you tried tls://

for SMTP try
tls://smtp.strato.de
port 587 or 465

Opencart doesn't encrypt emails - emails are encrypted by the protocol used - ssl or tls
Well the transmission between servers the actual email itself is not encrypted as such
Last edited by mikeinterserv on Mon Mar 08, 2021 7:45 am, edited 1 time in total.

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by matthewbaynham » Mon Mar 08, 2021 7:23 am

I've tried to copy the GLPI settings (see attachment) using IMAP and it doesn't encrypt but it does send the email.

I've tried using SMTP and it doesn't encrypt but it does send the email.

I've tried a combination of tls and ssl with both IMAP and SMTP.

Image

Attachments

Screenshot from 2021-03-07 00-13-33.png

Screenshot from 2021-03-07 00-13-33.png (66.08 KiB) Viewed 660 times


New member

Posts

Joined
Fri Nov 01, 2019 9:18 pm

Post by mikeinterserv » Mon Mar 08, 2021 7:46 am

Well you are not encrypting emails are you
Email encryption and email transmission via tls or ssl are entirely different things.
If you want encrypted email literally you need to sign the email
and the recipient needs your certificate installed
Your screenshot is incoming mailbox not outgoing mail settings
If you were successful sending via tls;// on port 587 or ssl://on 465 there is no reason for the google warning.
Maybe there is some issue with your host
Can you send the email source ( in gmail on right 3 dots its show original) for the email sent on 465 ssl or 587 tls to google account.

I would advise you try the MAIL in mail engine, for most hosts that will be tls - you don't have to specify anything.
leave the f- setting in mail parameters and try and make sure the from address and the store address are the same.

Here where your email outgoing settings are in GLPi
Setup > Notifications > Email followups configuration

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by matthewbaynham » Mon Mar 08, 2021 5:09 pm

I did it I got it to work.

A fresh morning and a fresh coffee.

I decided to to every possible combination of:
  • Mail engine: mail versus smtp
  • SMTP Hostname: with the prefix either tls:// or ssl://
  • SMTP Port: set to either 465 or 587 or 993
Simply a systematic brute-force try everything tactic.

There aren't that many combinations of all those variable and I got the right combination...
  • Mail engine: smtp
  • SMTP Hostname prefix tls
  • SMTP Port 587
And it works when I receive an email in gmail now gmail says it's encrypted with TLS.

Thank you for your help.

New member

Posts

Joined
Fri Nov 01, 2019 9:18 pm

Post by Sbranch » Tue Mar 09, 2021 6:57 am

Using Opencart Version 3.0.3.7

A2 Hosting for web server

The following email settings in >>>System>>>> Settings>>>>email tab
work.

Mail Engine: SMTP
Mail Parameters: your store email i.e. yourstoreemail@yourdomain.com
SMTP Hostname: ssl://yourdomain.com
SMTP Username : your user name
SMTP Password: Your password
SMTP Port: 465
SMTP Timeout: 10

Hopefully this helps someone. Good luck

Newbie

Posts

Joined
Thu Mar 12, 2020 12:23 am
Who is online

Users browsing this forum: mattltm and 323 guests