How to Handle OpenCart 2.0.2.0 SMTP Configuration Problems

Updated on Jun 11, 2019

It is always a good idea to keep up with the latest release of the application that you are using. When it comes to OpenCart, the latest 2.0.2.0 release introduced a large number of improvements and bug fixes and we do recommend an upgrade of your website if you are using the 2.x series. FastComet offers free upgrade service on each OpenCart Hosting plan so our techs will gladly handle the process for you, making sure that there is a backup copy of your website before the actual upgrade.

The latest OpenCart 2.0.2.0 release introduced a large number of improvements and bug fixes. It is always a good idea to keep up with the latest release of the application that you are using for the However, at the same time, we have noticed that there are a lot of clients complaining about issues with their mail service when configured with SMTP.

The Issue

The issue with the OpenCart 2.0.2.0 release that we spotted, is that a lot of clients that are using SMTP for the mail service of their website, experienced difficulties. The emails were not sending out and the OpenCart error_log was displaying the following warnings:

Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in /opencart-path/system/library/mail.php on line 168
fsockopen(): unable to connect to :465 (php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known) in /opencart-path/system/library/mail.php on line 168Notice: Error: php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known (0) in /opencart-path/system/library/mail.php on line 171

or

PHP Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /opencart-path/system/library/mail.php on line 168
PHP Warning: fsockopen(): unable to connect to :25 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /opencart-path/system/library/mail.php on line 168

This is not related to the hosting environment and if the SMTP configuration was previously working, this only indicated an issue with the latest OpenCart 2.0.2.0 patch.

We have tracked the warnings down to an issue with the actual upgrade package of OpenCart 2.0.2.0. It appears that the config_mail_smtp_host variable was changed to config_mail_smtp_hostname, but there are instances, where the old name was not replaced with the new one. This is the reason why the SMTP configuration for the mail service of OpenCart does not work properly.

Solution

There is no elegant solution to that and it requires code modifications. You will have to manually replace all instances, where the old config_mail_smtp_host is used and change it to config_mail_smtp_hostname. This will fix the issue completely for you and allow you to use the mail service of OpenCart with SMTP. If you are an existing FastComet client, we will gladly perform the change for you. Simply access your Client Area and open a new support ticket to our team. We are available 24/7 at your service so we will gladly assist in resolving that, so you can have a trouble-free experience with the use of OpenCart!

We hope you find this article useful. Discover more about FastCloud - the top-rated Hosting Solutions for personal and small business websites in four consecutive years by the HostAdvice Community!

OpenCart Hosting

  • Free Installation
  • 24/7 OpenCart Support
  • Free Domain for life
  • Hack-free Protection
  • Fast SSD Storage
  • Free OpenCart Themes
  • Free OpenCart Transfer
  • Free CloudFlare CDN
View More