Post by mfmcb » Mon Oct 25, 2021 5:37 pm

In footer Click on contact us will show this Warning: sprintf(): Too few arguments in catalog/controller/information/contact.php on line 23

New member

Posts

Joined
Sat Jul 04, 2020 12:46 am

Post by paulfeakins » Mon Oct 25, 2021 6:06 pm

mfmcb wrote:
Mon Oct 25, 2021 5:37 pm
In footer Click on contact us will show this Warning: sprintf(): Too few arguments in catalog/controller/information/contact.php on line 23
Must be caused by an installed extension. Remove them one-by-one until the error goes away.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by DigitCart » Mon Oct 25, 2021 6:21 pm

Hi
It seems the issue is related to your language file.
This is the code:

Code: Select all

$mail->setSubject(html_entity_decode(sprintf($this->language->get('email_subject'), $this->request->post['name']), ENT_QUOTES, 'UTF-8'));
Check this file:
catalog\language\{your language folder}\information\contact.php
You should have something like this:

Code: Select all

$_['email_subject']  = 'Enquiry %s';
%s should be there.

My Extensions


User avatar
Active Member

Posts

Joined
Thu Jun 22, 2017 5:32 pm


Post by mfmcb » Mon Oct 25, 2021 7:14 pm

DigitCart wrote:
Mon Oct 25, 2021 6:21 pm
Hi
It seems the issue is related to your language file.
This is the code:

Code: Select all

$mail->setSubject(html_entity_decode(sprintf($this->language->get('email_subject'), $this->request->post['name']), ENT_QUOTES, 'UTF-8'));
Check this file:
catalog\language\{your language folder}\information\contact.php
You should have something like this:

Code: Select all

$_['email_subject']  = 'Enquiry %s';
%s should be there.
I try your way, and this time the error change for this:
Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in public_html/system/library/mail/smtp.php on line 88

New member

Posts

Joined
Sat Jul 04, 2020 12:46 am

Post by JNeuhoff » Mon Oct 25, 2021 8:59 pm

Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in public_html/system/library/mail/smtp.php on line 88
Well, that's an issue now with your wrong SMTP settings in OpenCart's admin setings.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by mfmcb » Thu Oct 28, 2021 3:38 pm

JNeuhoff wrote:
Mon Oct 25, 2021 8:59 pm
Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in public_html/system/library/mail/smtp.php on line 88
Well, that's an issue now with your wrong SMTP settings in OpenCart's admin setings.
I was set up Gmail SMTP.
But still not working.

New member

Posts

Joined
Sat Jul 04, 2020 12:46 am

Post by ADD Creative » Thu Oct 28, 2021 4:09 pm

What SMTP settings are you using?

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by mfmcb » Thu Oct 28, 2021 4:27 pm

ADD Creative wrote:
Thu Oct 28, 2021 4:09 pm
What SMTP settings are you using?
Mail Engine : SMTP
SMTP Hostname : smtp.gmail.com
SMTP Username: MY EMAIL
SMTP Password : APP Password
SMTP Port: 465 (465=SSL // 587=TLS // 25=standard)

the port all try it.

New member

Posts

Joined
Sat Jul 04, 2020 12:46 am

Post by straightlight » Thu Oct 28, 2021 7:39 pm

mfmcb wrote:
Thu Oct 28, 2021 4:27 pm
ADD Creative wrote:
Thu Oct 28, 2021 4:09 pm
What SMTP settings are you using?
Mail Engine : SMTP
SMTP Hostname : smtp.gmail.com
SMTP Username: MY EMAIL
SMTP Password : APP Password
SMTP Port: 465 (465=SSL // 587=TLS // 25=standard)

the port all try it.
The last option of your mail form settings in your OC admin > systems > settings > edit settings > mail tab has not been provided. In the meantime, for gmail, using port 465, the hostname should be: ssl://smtp.gmail.com . For port 587, it should be: tls://smtp.gmail.com . However, I would rather recommend the port 465 solution.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by mfmcb » Thu Oct 28, 2021 11:09 pm

straightlight wrote:
Thu Oct 28, 2021 7:39 pm
mfmcb wrote:
Thu Oct 28, 2021 4:27 pm
ADD Creative wrote:
Thu Oct 28, 2021 4:09 pm
What SMTP settings are you using?
Mail Engine : SMTP
SMTP Hostname : smtp.gmail.com
SMTP Username: MY EMAIL
SMTP Password : APP Password
SMTP Port: 465 (465=SSL // 587=TLS // 25=standard)

the port all try it.
The last option of your mail form settings in your OC admin > systems > settings > edit settings > mail tab has not been provided. In the meantime, for gmail, using port 465, the hostname should be: ssl://smtp.gmail.com . For port 587, it should be: tls://smtp.gmail.com . However, I would rather recommend the port 465 solution.
I know but no matter how I change the setting of the port. even I try to use a different hostname with a relevant port. still not working.

New member

Posts

Joined
Sat Jul 04, 2020 12:46 am

Post by straightlight » Thu Oct 28, 2021 11:11 pm

mfmcb wrote:
Thu Oct 28, 2021 11:09 pm
straightlight wrote:
Thu Oct 28, 2021 7:39 pm
mfmcb wrote:
Thu Oct 28, 2021 4:27 pm

Mail Engine : SMTP
SMTP Hostname : smtp.gmail.com
SMTP Username: MY EMAIL
SMTP Password : APP Password
SMTP Port: 465 (465=SSL // 587=TLS // 25=standard)

the port all try it.
The last option of your mail form settings in your OC admin > systems > settings > edit settings > mail tab has not been provided. In the meantime, for gmail, using port 465, the hostname should be: ssl://smtp.gmail.com . For port 587, it should be: tls://smtp.gmail.com . However, I would rather recommend the port 465 solution.
I know but no matter how I change the setting of the port. even I try to use a different hostname with a relevant port. still not working.
Then you're not changing it right. See your cPanel's Email settings for your email account (with SSL option) on what should be the right parameter to be used. Alternatively, you could either contact your host or create a new service request in the Commercial Support section of the forum, or contact me directly via the forum PM, to have this issue investigated as a custom job.

In the meantime, please post a screenshot of your OC email form settings (without password) and post your latest PHP error logs about the latest changes you tried.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by mfmcb » Fri Oct 29, 2021 12:21 am

straightlight wrote:
Thu Oct 28, 2021 11:11 pm
mfmcb wrote:
Thu Oct 28, 2021 11:09 pm
straightlight wrote:
Thu Oct 28, 2021 7:39 pm


The last option of your mail form settings in your OC admin > systems > settings > edit settings > mail tab has not been provided. In the meantime, for gmail, using port 465, the hostname should be: ssl://smtp.gmail.com . For port 587, it should be: tls://smtp.gmail.com . However, I would rather recommend the port 465 solution.
I know but no matter how I change the setting of the port. even I try to use a different hostname with a relevant port. still not working.
Then you're not changing it right. See your cPanel's Email settings for your email account (with SSL option) on what should be the right parameter to be used. Alternatively, you could either contact your host or create a new service request in the Commercial Support section of the forum, or contact me directly via the forum PM, to have this issue investigated as a custom job.

In the meantime, please post a screenshot of your OC email form settings (without password) and post your latest PHP error logs about the latest changes you tried.
OK, I have uploaded to ATTACH

Attachments

screenshot-cpanel.368ight.com-2021.10.29-00_20_01.png

screenshot-cpanel.368ight.com-2021.10.29-00_20_01.png (13.14 KiB) Viewed 1289 times

screenshot-368ight.com-2021.10.29-00_17_45.png

screenshot-368ight.com-2021.10.29-00_17_45.png (37.61 KiB) Viewed 1289 times


New member

Posts

Joined
Sat Jul 04, 2020 12:46 am

Post by straightlight » Fri Oct 29, 2021 12:27 am

mfmcb wrote:
Fri Oct 29, 2021 12:21 am
straightlight wrote:
Thu Oct 28, 2021 11:11 pm
mfmcb wrote:
Thu Oct 28, 2021 11:09 pm


I know but no matter how I change the setting of the port. even I try to use a different hostname with a relevant port. still not working.
Then you're not changing it right. See your cPanel's Email settings for your email account (with SSL option) on what should be the right parameter to be used. Alternatively, you could either contact your host or create a new service request in the Commercial Support section of the forum, or contact me directly via the forum PM, to have this issue investigated as a custom job.

In the meantime, please post a screenshot of your OC email form settings (without password) and post your latest PHP error logs about the latest changes you tried.
OK, I have uploaded to ATTACH
The first screenshot you sent are not the PHP error logs. That's the PHP version. Please look in your file manager / FTP for the error_log file in your opencart root folder or in the admin. If you can't find this file, and using cPanel, look in your log folder for your SSL .tar or .tar.gz . If you don't use cPanel, contact your host to provide those logs.

Alternatively, you could look in your OC admin > systems > maintenance > error logs or in your storage/logs folder on your file server for the latest entries about your email settings.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by mfmcb » Fri Oct 29, 2021 1:41 am

straightlight wrote:
Fri Oct 29, 2021 12:27 am
mfmcb wrote:
Fri Oct 29, 2021 12:21 am
straightlight wrote:
Thu Oct 28, 2021 11:11 pm


Then you're not changing it right. See your cPanel's Email settings for your email account (with SSL option) on what should be the right parameter to be used. Alternatively, you could either contact your host or create a new service request in the Commercial Support section of the forum, or contact me directly via the forum PM, to have this issue investigated as a custom job.

In the meantime, please post a screenshot of your OC email form settings (without password) and post your latest PHP error logs about the latest changes you tried.
OK, I have uploaded to ATTACH

The first screenshot you sent are not the PHP error logs. That's the PHP version. Please look in your file manager / FTP for the error_log file in your opencart root folder or in the admin. If you can't find this file, and using cPanel, look in your log folder for your SSL .tar or .tar.gz . If you don't use cPanel, contact your host to provide those logs.

Alternatively, you could look in your OC admin > systems > maintenance > error logs or in your storage/logs folder on your file server for the latest entries about your email settings.
OK this is in admin> systems> maintenance> error logs show:
2021-10-28 16:16:44 - PHP Warning: fsockopen(): Peer certificate CN=`ns77.hostingspeed.net' did not match expected CN=`smtp.gmail.com' in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:16:44 - PHP Warning: fsockopen(): Failed to enable crypto in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:16:44 - PHP Warning: fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Unknown error) in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:17:23 - PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:17:23 - PHP Warning: fsockopen(): Failed to enable crypto in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:17:23 - PHP Warning: fsockopen(): unable to connect to ssl://smtp.gmail.com:587 (Unknown error) in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:26:48 - PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:26:48 - PHP Warning: fsockopen(): Failed to enable crypto in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:26:48 - PHP Warning: fsockopen(): unable to connect to ssl://smtp.gmail.com:587 (Unknown error) in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88

New member

Posts

Joined
Sat Jul 04, 2020 12:46 am

Post by straightlight » Fri Oct 29, 2021 2:05 am

mfmcb wrote:
Fri Oct 29, 2021 1:41 am
straightlight wrote:
Fri Oct 29, 2021 12:27 am
mfmcb wrote:
Fri Oct 29, 2021 12:21 am


OK, I have uploaded to ATTACH

The first screenshot you sent are not the PHP error logs. That's the PHP version. Please look in your file manager / FTP for the error_log file in your opencart root folder or in the admin. If you can't find this file, and using cPanel, look in your log folder for your SSL .tar or .tar.gz . If you don't use cPanel, contact your host to provide those logs.

Alternatively, you could look in your OC admin > systems > maintenance > error logs or in your storage/logs folder on your file server for the latest entries about your email settings.
OK this is in admin> systems> maintenance> error logs show:
2021-10-28 16:16:44 - PHP Warning: fsockopen(): Peer certificate CN=`ns77.hostingspeed.net' did not match expected CN=`smtp.gmail.com' in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:16:44 - PHP Warning: fsockopen(): Failed to enable crypto in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:16:44 - PHP Warning: fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Unknown error) in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:17:23 - PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:17:23 - PHP Warning: fsockopen(): Failed to enable crypto in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:17:23 - PHP Warning: fsockopen(): unable to connect to ssl://smtp.gmail.com:587 (Unknown error) in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:26:48 - PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:26:48 - PHP Warning: fsockopen(): Failed to enable crypto in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:26:48 - PHP Warning: fsockopen(): unable to connect to ssl://smtp.gmail.com:587 (Unknown error) in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
Then, there you go. Contact your host to resolve this issue.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by mfmcb » Wed Nov 03, 2021 12:10 am

straightlight wrote:
Fri Oct 29, 2021 2:05 am
mfmcb wrote:
Fri Oct 29, 2021 1:41 am
straightlight wrote:
Fri Oct 29, 2021 12:27 am



The first screenshot you sent are not the PHP error logs. That's the PHP version. Please look in your file manager / FTP for the error_log file in your opencart root folder or in the admin. If you can't find this file, and using cPanel, look in your log folder for your SSL .tar or .tar.gz . If you don't use cPanel, contact your host to provide those logs.

Alternatively, you could look in your OC admin > systems > maintenance > error logs or in your storage/logs folder on your file server for the latest entries about your email settings.
OK this is in admin> systems> maintenance> error logs show:
2021-10-28 16:16:44 - PHP Warning: fsockopen(): Peer certificate CN=`ns77.hostingspeed.net' did not match expected CN=`smtp.gmail.com' in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:16:44 - PHP Warning: fsockopen(): Failed to enable crypto in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:16:44 - PHP Warning: fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Unknown error) in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:17:23 - PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:17:23 - PHP Warning: fsockopen(): Failed to enable crypto in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:17:23 - PHP Warning: fsockopen(): unable to connect to ssl://smtp.gmail.com:587 (Unknown error) in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:26:48 - PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:26:48 - PHP Warning: fsockopen(): Failed to enable crypto in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:26:48 - PHP Warning: fsockopen(): unable to connect to ssl://smtp.gmail.com:587 (Unknown error) in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
Then, there you go. Contact your host to resolve this issue.
I contacted the service provider and they pointed out that the problem was caused by SMTP.PHP and I needed to troubleshoot it myself.

I check SMTP.PHP, I wonder if the following code is correct?
<?php
namespace Mail;
class Smtp {
public $smtp_hostname ;
public $smtp_username ;
public $smtp_password ;
public $smtp_port = 25;
public $smtp_timeout = 5;
public $max_attempts = 3;
public $verp = false;

New member

Posts

Joined
Sat Jul 04, 2020 12:46 am

Post by JNeuhoff » Wed Nov 03, 2021 12:44 am

That looks like a lame excuse by the webhost to me. You may consider switching to a better webhost. There is nothing wrong with the system/library/mail/smtp.php !

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by mfmcb » Wed Nov 03, 2021 11:08 pm

JNeuhoff wrote:
Wed Nov 03, 2021 12:44 am
That looks like a lame excuse by the webhost to me. You may consider switching to a better webhost. There is nothing wrong with the system/library/mail/smtp.php !
Forget it, it seems that it cannot be solved, because the server indicates that the related settings are normal. Looking at the error log, it means that there is a problem with smtp.php.
But if it is correct, then this problem may not be solved

New member

Posts

Joined
Sat Jul 04, 2020 12:46 am

Post by ADD Creative » Thu Nov 04, 2021 12:34 am

The error logs posted say there is a problem with the PHP functions used by smtp.php being able to establish a secure connection, not with smtp.php itself.

The first one smtp.gmail.com it tried to open a secure connection to smtp.gmail.com, but the reply was from ns77.hostingspeed.net. This could indicate your host is rerouting connections to port 465.

The second set of errors were caused by using ssl:// on port 587, which won't work. You need to use ssl:// on port 465 or tls:// on port 587. You can't mix them.

Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by straightlight » Sat Nov 06, 2021 6:32 am

mfmcb wrote:
Wed Nov 03, 2021 12:10 am
straightlight wrote:
Fri Oct 29, 2021 2:05 am
mfmcb wrote:
Fri Oct 29, 2021 1:41 am


OK this is in admin> systems> maintenance> error logs show:
2021-10-28 16:16:44 - PHP Warning: fsockopen(): Peer certificate CN=`ns77.hostingspeed.net' did not match expected CN=`smtp.gmail.com' in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:16:44 - PHP Warning: fsockopen(): Failed to enable crypto in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:16:44 - PHP Warning: fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Unknown error) in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:17:23 - PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:17:23 - PHP Warning: fsockopen(): Failed to enable crypto in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:17:23 - PHP Warning: fsockopen(): unable to connect to ssl://smtp.gmail.com:587 (Unknown error) in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:26:48 - PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages:
error:1408F10B:SSL routines:ssl3_get_record:wrong version number in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:26:48 - PHP Warning: fsockopen(): Failed to enable crypto in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
2021-10-28 16:26:48 - PHP Warning: fsockopen(): unable to connect to ssl://smtp.gmail.com:587 (Unknown error) in /home/d68itcom/public_html/system/library/mail/smtp.php on line 88
Then, there you go. Contact your host to resolve this issue.
I contacted the service provider and they pointed out that the problem was caused by SMTP.PHP and I needed to troubleshoot it myself.

I check SMTP.PHP, I wonder if the following code is correct?
<?php
namespace Mail;
class Smtp {
public $smtp_hostname ;
public $smtp_username ;
public $smtp_password ;
public $smtp_port = 25;
public $smtp_timeout = 5;
public $max_attempts = 3;
public $verp = false;
It's not an issue with the SMTP library, It's simply because you haven't sent them the full error message or you may have sent them the full error message but they simply didn't understand where they need to install the crypto server library to solve the issue. Sometimes, when the issue is not caused by a user error, then tech. support simply needs to focus on these logs. Right now, as said above, it is related to a certificate issue where the best option would be for your host to fix this. Once both issues resolved, try again with your SMTP ports.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 271 guests