I'm getting this error on my local machine when sending emails using (gmail's smtp + PHPMailer + CodeIgniter), which I wasn't getting on our previous office (we had to move offices).
Message: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution
Message: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:465 (php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution)
- I already asked our sysad to open port 465, but I'm still getting the error
- I tested the same app deployed in another server and it is working there
- I didn't change any configurations in my local machine
- I already forwarded the outside interface's port 465 to my machine's IP
- Opened accesses to port 465 to my IP
I was wondering whether this error has something to do with the change in the network setup. What are the possible causes of this error? Also, what are the possible solutions?
telnet smtp.gmail.com 465
Trying 22.214.171.124... Connected to smtp.gmail.com. Escape character is '^]'.`
openssl s_client -connect smtp.gmail.com:465
Server: 126.96.36.199 Address: 188.8.131.52#53 Non-authoritative answer: smtp.gmail.com canonical name = gmail-smtp-msa.l.google.com. Name: gmail-smtp-msa.l.google.com Address: 184.108.40.206
Edit From this link (http://bugs.php.net/bug.php?id=11058) posted by sh1ny, it was mentioned that restarting apache fixes the problem. It worked for me. But I still do not understand why. Got clues?