Opencart lets you to send email by:
- PHP Mail (sent from web server)
- or SMTP (usually sent from another server)
PHP Mail VS SMTP which is best?
Both work well although PHP Mail is usually faster and already setup on most servers.
- The problem with sending emails using PHP Mail is that it gets sent from your website/server using the hostname they provide and not your domain name.
+ SMTP is more reliable and less likely to end in your customer's junk folder.
+ SMTP account will also usually include extra DNS settings to validate your domain further with an SPF record and DKIM signature.
[OPTIONAL] You can install phpMailer to replace opencarts Mail class. Works in a similar way although it ensures extra email headers are included (SPF, DKIM) and fixes old display issues on Apple Mail showing an empty preview in the inbox. Download free opencart extension:
[OPTIONAL] Admin Multi Mail SMTP adds the Mail tab to additional stores too. Download free opencart extension:
Setting up your emails with Opencart can be very easy.
- Login to your Opencart Admin and go to System -> Store Settings - Mail tab.
For testing you can use a google mail address as a SMTP settings below but for live site it’s recommend using an email address ending in the same as your domain name.
Mail Protocol: SMTP (or phpmailer)
SMTP Host: smtp.gmail.com
(try without first or: ssl://smtp.gmail.com or tls:// smtp.gmail.com)
SMTP Username: firstname.lastname@example.org
(try with: @googlemail)
SMTP Password: p333&&^w000rd
SMTP Port: 465 (465=SSL // 587=TLS // 25=standard)
- Login to your google account and go to Account Security: https://myaccount.google.com/security
Check if you have 2 step authentication's enabled? You’ll need a google specific application password instead
Otherwise you need to enable Less Secure Apps Sign In
- Visit: https://www.google.com/accounts/DisplayUnlockCaptcha
- Login to Gmail this time and go to account 'Settings', here check that 'Forwarding and POP/IMAP' is Enabled IMAP and/or POP.
DKMI - DomainKeys Identified Mail
DNS - Domain Name System
SMTP - Simple Mail Transfer Protocol
SPF - Sender Framework Policy
More information in the google answer:
Also a nice article explaining this in further detail: