In order to interact with your customers through your system on e-commerce sites, to inform your customers whether their transactions are successful, and at what stages the transactions are, a notification is sent via opencart via e-mail. However, in some cases, your opencart smtp settings may not allow you to perform these operations. The reason may be that you have not set your smtp mail settings, or even if you do the settings, you may not be able to set your opencart system fully compatible with your host settings due to some security measures taken by hosting companies. Below, you can find first how to make the opencart smtp settings and then the final touches that will make your system suitable for these settings with a few small steps.
First of all, login to Opencart admin and go to System> Stores from the control panel, select the E-mail tab and make the following settings.
Important: Your e-mail address must be the same as your e-mail address in the Store tab.
Opencart SMTP Mail Configuration Settings
- Log in to your OpenCart control panel as an administrator.
- Click the Stores link on the System tab.
- Select your store to make adjustments and click edit.
- Click the E-Mail tab and edit your smtp mail configuration as follows.
E-Mail Protocol: SMTP
Mail Parameters: Leave blank
SMTP Host Name: ssl: //mail.hosting your company name.com
SMTP Username: firstname.lastname@example.org
SMTP Password: Mail Password such as 12345..
SMTP Port: 587
SMTP Timeout: 5
Additional E-Mail Addresses: Leave blank.
After opencart system> store settings, in cpanel> file manager> public_html folder
Change the values in lines 226 and 228 in the smtp.php file under the \ system \ library \ mail folder as follows.
Line 226 fputs ($ handle, ‘MAIL FROM: <‘. $ This-> from. ‘> XVERP ‘.“ \ R \ n ”); this line
Line 226 fputs ($ handle, ‘MAIL FROM: <‘. $ This-> smtp_username. ‘> XVERP ‘.“ \ R \ n ”); change it that way.
Line 228 fputs ($ handle, ‘MAIL FROM: <‘. $ This-> from. ‘> ‘.“ \ R \ n ”); this line
Line 228 fputs ($ handle, ‘MAIL FROM: <‘. $ This-> smtp_username. ‘> ‘.“ \ R \ n ”); change it that way.
After changing these two lines of code, opencart will start sending e-mails and receiving e-mails from the contact form.
Remember, before changing the opencart codes, do not forget to take the opencart backup and database backup.