Page 1 of 1

email problems

Posted: Wed Nov 25, 2020 9:01 am
by Capstan
Trying to complete the configuration of OC 3.2 on an Ubuntu server. I have root access to it and went through all the install steps successfully, but email notifications don't work. Looking through the forum posts I am seeing that other people have had email problems and solved them but I am not clear on how to debug this. What can I look at? The error log doesn't show anything.

All events are enabled in extensions->events. On the mail panel in home->stores->settings I have set the mail engine to SMTP with the appropriate port for outgoing email (which works with other apps). My email service uses SSL so I put "ssl://" in front of the server hostname. All of the alerts are checked.

Submitting a review or a contact message appears to succeed but no email is received. Is there something else I need to install? Is there some logfile I can look at? Any suggestions much appreciated.

Re: email problems

Posted: Wed Nov 25, 2020 11:18 am
by sw!tch
Capstan wrote:
Wed Nov 25, 2020 9:01 am
Submitting a review or a contact message appears to succeed but no email is received. Is there something else I need to install? Is there some logfile I can look at? Any suggestions much appreciated.
Nowadays and depending on your email service, you may require SPF & DKIM records added to your DNS / Zone file. Without this, some providers may drop the email as spam.

Re: email problems

Posted: Thu Nov 26, 2020 12:33 am
by ADD Creative
You may need to check your PHP error log as well as your OpenCart one. You should also check you servers MTA (mail transfer agent) logs. If you are using cPanel you can also look in Track Delivery under Email.

If your are sure the email is leaving your mail server you can use an online email deliverability tester to see how other email servers will see you emails.

Re: email problems

Posted: Thu Nov 26, 2020 5:47 am
by Capstan
Thanks for the suggestions. What code in OC is attempting to send this email? There is no cPanel on my server, it is an Ubuntu instance where I have installed everything manually including OC and PHP 7. Perhaps OC is attempting to use a native email utility in Ubuntu?

I am thinking this is a situation that can occur for many OC users. It seems like there should be a 'test' button for sending email and a visible log that shows the attempt and the results.

Re: email problems

Posted: Thu Nov 26, 2020 6:36 am
by sw!tch
Mail is composed in the mail classes.

Code: Select all

system/library/mail/mail.php. // PHP sendmail()
system/library/mail/smtp.php. // SMTP
You can see its class usage in the contact controller, that's the easiest one to test with since it doesn't use events.

Code: Select all

catalog/controller/information/contact.php