I am using Opencart 2.3.0.2 version. I am facing issue with receiving emails from the store. I did the setting from System > Setting > Mail.
I am not getting emails from contact form or for any new order placed in the store.
I tried with SMTP and set hostname as ssl://smtp.gmail.com but in this case, when I submit contact form I am getting error
Warning: fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Connection refused)
I did search on this issue and found some solution on StackOverflow but none of them worked for me.
I tried simple mail function by creating a test page and that works for me.
I am trying to fix this issue from past 2 days but still didn't found any solution.
Help me to resolve this issue.
Thanks in advance.
It's a common problem that emails somehow don't end up in the inbox they are supposed to when sent from a web server and there are loads of possible explanations but here are 3:
Your server is blocking them on purpose, which can be configured in cPanel as described here: https://www.antropy.co.uk/blog/emails-not-arriving-using-smtp/
Your web server is thinking the destination inbox is on the server itself but you are using a remote mail service: https://www.antropy.co.uk/blog/contact-form-not-sending-email/
Your web server doesn't have very good deliverability and emails are ending up in the spam folder, so use a separate SMTP to send: https://www.antropy.co.uk/blog/how-to-stop-opencart-emails-going-to-spam-by-using-smtp/