I am trying to add a python script to a shared web hosting account and I cannot get even the most basic of scripts to establish a valid imap connection to gmail. Just as a test case, I created the following script:
import imaplib
conn = imaplib.IMAP4_SSL("imap.gmail.com", 993)
conn.login(<EMAIL_ADDRESS>, <PASSWORD>)
This produces the following ouput:
Traceback (most recent call last):
File "imapTest.py", line 2, in ? conn = imaplib.IMAP4_SSL("imap.gmail.com", 993) File "/usr/lib64/python2.4/imaplib.py", line 1101, in init IMAP4.init(self, host, port) File "/usr/lib64/python2.4/imaplib.py", line 160, in init self.open(host, port) File "/usr/lib64/python2.4/imaplib.py", line 1113, in open self.sock.connect((host, port)) File "", line 1, in connect socket.error: (110, 'Connection timed out')
How would I go about troubleshooting this issue? Is it possible that my hosting provider is blocking outgoing imap requests?