0

I'm writing a program to read emails from python

when I execute below code it hangs in the last line

import imaplib
mail_server = "192.168.2.2"
connection = imaplib.IMAP4_SSL(mail_server,993)

I have already opened port 993.

is any other port permissions are required for imap connection to work?

0

Once you have connected to IMAP you will need login credentials. There are a variety of formats that could be required depending on the configuration of the IMAP server. Opening a connection to an IMAP server gives you very little functionality until you have logged in as the desired user.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.