I am trying to backup all my contacts who sent me mails in Gmail. One way of doing is by using IMAPSize to back my account.

But while configuring my account, I get the following error:

Can’t connect to server imap.gmail.com. Host is not valid or port is incorrect

Any idea?

  • Have you enabled IMAP in your Gmail settings? Are you using port 993?
    – John C
    Aug 8, 2012 at 7:39
  • I'm having the same problem. It seems IMAPSize is not able to establish an encrypted connection through port 993. My email provider allows connection through un-encrypted connection and port 143 and this works.
    – mgutt
    Feb 6, 2020 at 14:34

1 Answer 1


As John said, make sure you have IMAP enabled in Gmail's settings. If you're connecting to port 993, make sure IMAPSize knows this port expects SSL connections.

When you say you want to "backup all my contacts", do you mean you want to backup emails exchanged with them or just their name and addresses? If its the latter, have a look at context.io/docs/2.0/accounts/contacts

(disclaimer: I'm the founder of Context.IO)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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