Two possibilities. One, the socket doesn't exist; two the script doesn't have permission to write to it. For the connection to 110, there doesn't appear to be an active listening server on that port, or it's blocked by a firewall or other security mechanism, or the link is down.