Page 1 of 1

Problem with mail SMTP?

Posted: Sat Jan 23, 2021 4:59 am
by zigi00x
Hello warriors of opencart,

I have a problem with mail, sometimes I get this error:

Code: Select all

2021-01-11 14:45:40 - PHP Warning: fsockopen (): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/******/public_html/system/library/mail/smtp.php on line 87
2021-01-11 14:45:40 - PHP Warning: fsockopen (): unable to connect to smtp. *******. Com: 587 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in / home /pcrobots/public_html/system/library/mail/smtp.php on line 87
the problem occurs when creating an order, sending the status of the order to the customer, creating an account.

an error appears on the web and this in the log.

The error is displayed randomly and max 1-2 times a day, otherwise, everything works normally and emails normally work with the current settings, only occasionally this error is displayed, for example 40 emails in a row will be sent without error.

Anyone have any idea how to debug it?

Re: Problem with mail SMTP?

Posted: Sat Jan 23, 2021 5:16 am
by sw!tch
Some Webhosts or mail providers implement sending rate limits. Best to contact them or use a service better geared for sending mass mail such as mailgun, sendgrid, etc.

Re: Problem with mail SMTP?

Posted: Sat Jan 23, 2021 7:56 am
by ADD Creative
"php_network_getaddresses: getaddrinfo failed" means you server couldn't perform a DNS lookup. Could be a problem with DNS on the server or you are hitting some limit. Check your sever logs or ask your host.

Re: Problem with mail SMTP?

Posted: Mon Jan 25, 2021 7:40 pm
by paulfeakins
zigi00x wrote:
Sat Jan 23, 2021 4:59 am
Hello warriors of opencart,
Haha! And you have my keyboard, Frodo!

zigi00x wrote:
Sat Jan 23, 2021 4:59 am
PHP Warning: fsockopen (): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/******/public_html/system/library/mail/smtp.php on line 87
Looks like one for your web host.

Re: Problem with mail SMTP?

Posted: Mon Jan 25, 2021 9:51 pm
by EvolveWebHosting
Before contacting your hosting company, check to make sure your SMTP credentials are entered properly. If you copied and pasted your password into the field, make sure there is no space at the beginning or end of the password. If it's not working after that then contact your hosting companies support department.

Re: Problem with mail SMTP?

Posted: Tue Feb 09, 2021 3:22 pm
by Romaguera
sw!tch wrote:
Sat Jan 23, 2021 5:16 am
Some Webhosts or mail providers implement sending rate limits. Best to contact them or use a service better geared for sending mass mail such as mailgun, sendgrid, myaarpmedicare etc.
Thanks for the update and quick reply. I'll be sure to keep an eye on this thread. Looking for the same issue. Bumped into your thread. Thanks for creating it. Looking forward for solution.

Re: Problem with mail SMTP?

Posted: Sun Jul 11, 2021 11:46 pm
by zigi00x
Hi,

Is it weird that the error is only displayed when it is sent through the opencart platform, other email clients do not generate these errors?

I still haven't been able to fix the error, I haven't really paid much attention to it at the moment, I'll try to fix it as soon as possible and I'll present a solution here.

If someone has already fixed it, you can give me some details on how to do it.

Thanks.

Re: Problem with mail SMTP?

Posted: Sun Jul 11, 2021 11:48 pm
by zigi00x
EvolveWebHosting wrote:
Mon Jan 25, 2021 9:51 pm
Before contacting your hosting company, check to make sure your SMTP credentials are entered properly. If you copied and pasted your password into the field, make sure there is no space at the beginning or end of the password. If it's not working after that then contact your hosting companies support department.
Yes, everything is set correctly, if not, this error would not occur only occasionally but all the time.

Re: Problem with mail SMTP?

Posted: Sun Jul 11, 2021 11:48 pm
by zigi00x
paulfeakins wrote:
Mon Jan 25, 2021 7:40 pm
zigi00x wrote:
Sat Jan 23, 2021 4:59 am
Hello warriors of opencart,
Haha! And you have my keyboard, Frodo!

zigi00x wrote:
Sat Jan 23, 2021 4:59 am
PHP Warning: fsockopen (): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/******/public_html/system/library/mail/smtp.php on line 87
Looks like one for your web host.
I contacted support, we'll see what they tell me.

Re: Problem with mail SMTP?

Posted: Mon Jul 12, 2021 10:20 am
by hpwebdesign
zigi00x wrote:
Sat Jan 23, 2021 4:59 am
Hello warriors of opencart,

I have a problem with mail, sometimes I get this error:

Code: Select all

2021-01-11 14:45:40 - PHP Warning: fsockopen (): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/******/public_html/system/library/mail/smtp.php on line 87
2021-01-11 14:45:40 - PHP Warning: fsockopen (): unable to connect to smtp. *******. Com: 587 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in / home /pcrobots/public_html/system/library/mail/smtp.php on line 87
the problem occurs when creating an order, sending the status of the order to the customer, creating an account.

an error appears on the web and this in the log.

The error is displayed randomly and max 1-2 times a day, otherwise, everything works normally and emails normally work with the current settings, only occasionally this error is displayed, for example 40 emails in a row will be sent without error.

Anyone have any idea how to debug it?
Have you checked that SMTP setting is correct?

Try to test your domain email account. Login with email and password to your webmail.

eg: webmail.yourdomain.com or yourdomain.com:2096

Read more about OpenCart SMTP email setting: https://hpwebdesign.io/email-settings-opencart

Hope this help.

Re: Problem with mail SMTP?

Posted: Mon Jul 12, 2021 5:37 pm
by straightlight
The error log state port 587. Try with port 465. Also ask your webhost to install the crypto library on your domain if you don't have access to cPanel WHM or SSH as root for port 587.

Re: Problem with mail SMTP?

Posted: Tue Jul 20, 2021 12:53 am
by zigi00x
straightlight wrote:
Mon Jul 12, 2021 5:37 pm
The error log state port 587. Try with port 465. Also ask your webhost to install the crypto library on your domain if you don't have access to cPanel WHM or SSH as root for port 587.
I want to ask, can't it be a php version? does oc support 3.0.2.0 with php version 7.3.17?

Re: Problem with mail SMTP?

Posted: Tue Jul 20, 2021 1:47 am
by ADD Creative
zigi00x wrote:
Tue Jul 20, 2021 12:53 am
I want to ask, can't it be a php version? does oc support 3.0.2.0 with php version 7.3.17?
The issue is not with your PHP version. The issue is with your server/hosting. If your host can't fix the issue, you could look for a different host.

Re: Problem with mail SMTP?

Posted: Tue Jul 20, 2021 1:55 am
by JNeuhoff
zigi00x wrote:
Sun Jul 11, 2021 11:48 pm
I contacted support, we'll see what they tell me.

So have you had a response yet from your webhost?

Re: Problem with mail SMTP?

Posted: Tue Jan 04, 2022 5:20 pm
by aerogel
zigi00x wrote:
Sat Jan 23, 2021 4:59 am
Hello warriors of opencart,

I have a problem with mail, sometimes I get this error:

Code: Select all

2021-01-11 14:45:40 - PHP Warning: fsockopen (): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/******/public_html/system/library/mail/smtp.php on line 87
2021-01-11 14:45:40 - PHP Warning: fsockopen (): unable to connect to smtp. *******. Com: 587 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in / home /pcrobots/public_html/system/library/mail/smtp.php on line 87
use the IP address of your host instead. its a problem with dns.
ping "mail.yourdomain.com" and then grab the ip and use it.
that fixed my problem.