I have recently upgraded to 3 on one of my customers opencart installations. Everything works fine and I was able to make everything work as the customer is used to, but there is one issue that I'm struggling to solve and the customer is pushing me hard for it (understandably)
The issue is - opencart does not send emails after order checkout or account registration. I don't mean that the server is failing to send the mail (I'm running my own email server and there is no trace of any email being sent in the logs), but that the opencart installation doesn't even get to the code where mail is supposed to be sent. If I use the newsletter form in administration, all the emails are sent and delivered fine without any issues. All other applications on the same server using same PHP and sendmail are working without problems, as was the 2.3 OC installation with exactly same settings.
I tried adding debug code to catalog/controller/mail/order.php, but when completing an order, it doesn't trigger anywhere in this file (meaning that the process probably silently errored or is blocked by some condition earlier). But so far I haven't been able to pinpoint the exact place where the mail controller is called.
I don't know what other useful info I could give - the mail system is set to "Mail", I have tried filling the parameters field with "-f firstname.lastname@example.org", but as I said, the email doesn't seem to ever leave PHP since there is no trace of any attempt in any log.
Can someone help me with this issue?
Thanks in advance, Johny
first to reply to procheck - no I'm not using any admin panel, the server is my custom Debian based machine and I manage it myself.
to straightlight - my mail tab is configured correctly, with all the notification checkboxes checked and additional email address also provided (needs to be). Only thing not configured on that tab is the SMTP settings, since I want to use the Mail method.
The events page is another thing though and might be the source of the problem. I've got 1 single item in that table (voucher). Could you please elaborate a bit more on what that means? I will meanwhile try to find some docs on events myself.
Thanks a lot!
Issue spotted In your PHPMyAdmin - > Opencart database, truncate your oc_event table. Then, from Opencart ZIP file downloaded from opencart.com - > install/opencart.sql file, see the oc_event query where it starts with: insert into `oc_event` and take that entire block. In your PHPMyAdmin - > Opencart database - > SQL tab, execute the query and ensure to replace oc_ prefixes if using another database table prefix name before launching the queries.The events page is another thing though and might be the source of the problem. I've got 1 single item in that table (voucher). Could you please elaborate a bit more on what that means? I will meanwhile try to find some docs on events myself.
Mail Engine: SMTP.
Mail Parameters: Leave blank.
SMTP Hostname: tls://smtp.gmail.com
SMTP Username: email@example.com //This is the same email used for store email
SMTP Password: ***********
SMTP Port: 587 //Also tried 465 with ssl://smtp.gmail.com, also tried 25
SMTP Timeout: 10
Any help will be very much appreciated.
When you upgrade opencart from opencart 2 to opencart 3, the table event contains ro records. But then you see the fresh opencart 3 database, event table has 33 records. Just drop event table from latest migrated db and import event table from fresh opencart 3 db to upgraded opencart db. Now it will work.
Also make sure you have configure mail option for register in admin side.
Settings->edit store->mail tab.