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).
Severity: Warning
Message: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution
Severity: Warning
Message: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:465 (php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution)
Additional info:
- 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?
Edit:
telnet smtp.gmail.com 465
results to
Trying 74.125.127.109...
Connected to smtp.gmail.com.
Escape character is '^]'.`
Edit
openssl s_client -connect smtp.gmail.com:465
results to
CONNECTED
Edit
nslookup smtp.gmail.com
results to
Server: 171.103.2.3
Address: 171.103.2.3#53
Non-authoritative answer:
smtp.gmail.com canonical name = gmail-smtp-msa.l.google.com.
Name: gmail-smtp-msa.l.google.com
Address: 74.125.127.109
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?
smtp.gmail.comwith no protocol or port specified. – Anthony Aug 26 '09 at 7:27