Support community for TTG plugins and products.
NOTICE
The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.
This forum is now closed, and exists here as a read-only archive.
You are not logged in.
Pages: 1
I am having trouble with the email setup for contact us page.
I have setup the email configuration with the same settings I use for my email. But, when try to send a test contact us request I get the following error:
Something went wrong
file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in URLHelper.php on line 424
Any suggestions?
Offline
What settings are you using? Usually, the “Mail” option is the best.
Have you seen the documentation?
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
I've tried both mail and smtp.
Yes, I've read the linked documentation and my setup currently matches the recommendation.
Any other suggestions as to what I can try? Is there a server config in PHP that I need to make?
Last edited by gkar47 (2018-07-18 04:03:38)
Offline
Is there any way to get more of the error trace or error information when an error occurs? I'm trying various things to see if I can figure out what the system error is when I try to send an email for the contact page. When I use the "Send Test Email" function in the admin I get the following error and would like to get more info.
fsockopen(): php_network_getaddresses: getaddrinfo failed: System error in SMTP.php on line 125
I selected Yes for the "Show Debug Messages", but I didn't get any more info.
Offline
My suggestion is to send Ben (one of the developers) an email referencing this thread. Include Backlight Admin credentials. He may also need FTP access
http://community.theturninggate.net/profile.php?id=101
Rod
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site
Offline
Hi Bill, that looks like your server is unable to connect to the Internet. The line of code is called with an attempt to contact Google to verify the contact form recaptcha. That URL starts with https://www.google.com/recaptcha/api/siteverify (and includes parameters specific to the account associated with your recaptcha and the current request).
Can you ping google.com on the command line of the server? Can you connect to 443? (curl https://google.com should make a good test).
If not, you'll need to fix your server's network settings to allow this. If you can connect on the command line, another potential blocker is selinux. If so, you'll need to allow your web server to make contact to the Internet. Another potential blocker is any iptables or other firewall that may be blocking outgoing requests from your server.
Offline
I've checked and I can get out on ping and curl commands you suggested. The recaptcha also seems to work fine in that it accepts the verify and gives me a check mark.
I think it may be how I have the sendmail configured on my machine. I have never used it to send mail outside this server. I have only ever used it for local mail on the server. I can send to local users and can connect to it for those emails from other boxes on my network.
If this helps any I have displayed an entry in the journal on my attempt to send email from the admin test page:
Jul 19 12:57:36 sheridan.elliot.dhs.org sendmail[760]: w6IMZFGx010229: to=<bill@billelliot.ca>, ctladdr=<bill@sheridan.elliot.dhs.org> (1000/1000), delay=20:22:21, xdelay=00:02:00, mailer=esmtp, pri=2100323, relay=mx.easymail.ca. [64.68.200.59], dsn=4.0.0, stat=Deferred: Connection timed out with mx.easymail.ca.
Offline
The error is as stated. The server is not able to contact Google to confirm the recaptcha, after clicking submit. That error line is only reached in the codebase from the attempt to contact Google for recaptcha. You may get the tick from clicking the recaptcha but that is not the end of the recaptcha mechanism. The proof of the pudding would be to create a simple test php page called from your browser (so that it's via your web server and not command line) and see what results when attempting to run this line:
$output = file_get_contents('https://www.google.com/recaptcha/api/siteverify');
The expected result from that call is a response like:
{
"success": false,
"error-codes": [
"missing-input-response",
"missing-input-secret"
]
}
It sounds like sending email is another issue you need to solve.
Offline
The method to contact Google first tries to use curl, if it's installed on your server, and then attempts to use file_get_contents. Backlight expects false to be returned from those attempts. While curl behaves nicely and returns false on being unable to call the URL, file_get_contents throws an exception. I've modified my working code to catch the exception and return false, so that the Backlight will instead return the (slightly more) friendly message "Unable to contact reCAPTCHA service", along with continuing to show the contact form.
Offline
I'm still working on the email issue.
But, I tried your suggestion on creating a dummy php page to just run the file_get_contents and the output is an empty string. There is no output.
But, if I use curl at the command line I get the response you expect.
I also added the php-curl package and tried the code in URLHelper that is used and got the same empty string response.
Very strange.
Offline
Are there any errors in your Nginx error logs? Are you running selinux, which may disallow a web server from making server requests?
Offline
I'm not running selinux. I am running msec and have checked there and there is nothing there preventing access to the internet for any program.
I can't find anything in any of the log files for nginx or php-fpm that would indicate a problem.
Offline
I found I did have some errors in my mail and dns setups. These have been corrected and everything is now working correctly. So I have still having problems with the admin send test email. I created a test page to add error handling around the calls to mail->send and have found it is throwing the following error:
Exception: Function split() is deprecated
Any idea has to how to correct this problem?
Offline
Pages: 1