Page 1 of 1

Mail sending from fresh install - error code 500

Posted: Sun Apr 18, 2021 5:15 am
by otalialv
Hello, everybody!

I installed a Opencart 3.0.3.7.
I configure email via SMTP and set settings to:
Mail Engine = SMTP
Mail Parameters = mygmailmail@gmail.com
SMTP Hostname = tls://smtp.gmail.com
SMTP Username = mygmailmail@gmail.com
SMTP Password = Sorry not today =)
SMTP Port = 465
SMTP Timeout = 5

I create order, fill all fields and after when I prese Confirm order I receive pop-up message "Internal server error", ok, I opened developer console un receive a:
Failed to load resource: the server responded with a status of 500 (Internal Server Error) /index.php?route=extension/payment/cod/confirm

When i press confirm order I receive second message:
/index.php?route=extension/payment/cod/confirm:1 Failed to load resource: the server responded with a status of 500 (Internal Server Error)
jquery-2.1.1.min.js:4 GET /index.php?route=extension/payment/cod/confirm 500 (Internal Server Error)
send @ jquery-2.1.1.min.js:4
ajax @ jquery-2.1.1.min.js:4
eval @ VM20:2
dispatch @ jquery-2.1.1.min.js:3
r.handle @ jquery-2.1.1.min.js:3


Before using a Gmail account I tried to office 365 and riceive something error.


I checked all Google results and nothing.
Thanks!

Re: Mail sending from fresh install - error code 500

Posted: Sun Apr 18, 2021 6:10 am
by ADD Creative
You need to check your PHP error log. Sometimes error_log or use phpinfo(); to find it.

Re: Mail sending from fresh install - error code 500

Posted: Sun Apr 18, 2021 6:48 am
by thekrotek
Error 500 is a generic error. As said above, check your error logs.

Re: Mail sending from fresh install - error code 500

Posted: Sun Apr 18, 2021 9:55 am
by khnaz35
add
-f in front of your mail parameter

Re: Mail sending from fresh install - error code 500

Posted: Mon Apr 19, 2021 3:27 am
by otalialv
I checked all logs from my Cpanel and prom Opencart admin, I can't find any information about this issue, this just not exist at log files. :(

Re: Mail sending from fresh install - error code 500

Posted: Mon Apr 19, 2021 6:06 am
by ADD Creative
otalialv wrote:
Mon Apr 19, 2021 3:27 am
I checked all logs from my Cpanel and prom Opencart admin, I can't find any information about this issue, this just not exist at log files. :(
If you can't find an error_log in you web root or admin folder. Or use phpinfo(); to find it. Ask you host.

Re: Mail sending from fresh install - error code 500

Posted: Mon Apr 19, 2021 10:07 pm
by straightlight
otalialv wrote:
Mon Apr 19, 2021 3:27 am
I checked all logs from my Cpanel and prom Opencart admin, I can't find any information about this issue, this just not exist at log files. :(
Since you're using cPanel, I would suggest to check in your root FTP > logs folder for tar.gz files (most recent ones) and look at your error logs in there. You first need to download the file and extract the compressed data. These logs can basically be viewed in notepad.

Re: Mail sending from fresh install - error code 500

Posted: Sat May 08, 2021 7:16 pm
by otalialv
Hello!

This issue is actual, now i receive reply from server
2021-05-08 14:07:47 - PHP Warning: stream_socket_enable_crypto(): Peer certificate CN=`cpanel-3.hostnet.lv' did not match expected CN=`smtp.gmail.com' in /home/store/mystore.com/system/library/mail/smtp.php on line 129

any ideas ?

Re: Mail sending from fresh install - error code 500

Posted: Sat May 08, 2021 9:24 pm
by straightlight
otalialv wrote:
Sat May 08, 2021 7:16 pm
Hello!

This issue is actual, now i receive reply from server
2021-05-08 14:07:47 - PHP Warning: stream_socket_enable_crypto(): Peer certificate CN=`cpanel-3.hostnet.lv' did not match expected CN=`smtp.gmail.com' in /home/store/mystore.com/system/library/mail/smtp.php on line 129

any ideas ?
Contact your host to enable the crypto library.

Re: Mail sending from fresh install - error code 500

Posted: Sun May 09, 2021 3:50 am
by ADD Creative
otalialv wrote:
Sat May 08, 2021 7:16 pm
Hello!

This issue is actual, now i receive reply from server
2021-05-08 14:07:47 - PHP Warning: stream_socket_enable_crypto(): Peer certificate CN=`cpanel-3.hostnet.lv' did not match expected CN=`smtp.gmail.com' in /home/store/mystore.com/system/library/mail/smtp.php on line 129

any ideas ?
Could be that your host is blocking outing going SMTP.

Re: Mail sending from fresh install - error code 500

Posted: Mon May 10, 2021 5:11 am
by WXHosting
Add Creative is correct, your web hosting provider is blocking PHP from creating external SMTP connections. This quite commonly done by low cost hosting providers to prevent abuse from the millions of vulnerable scripts that end up getting hacked and a mail dispatch script gets dropped.

You will either need to make use of a non-smtp mail service like sendgrid (though their free / cheap plans below 'dedicated ip' are pretty useless). The other option would be use send mail from the local service you are on (assuming it provides such a service).