If you cannot login after multiple tries. There could be a few causes.
1) Few email providers disable IMAP access by default. You need to explicitly enable it. For instance, for GMX, this is how you do it.
2) The required port might not be open. In some firewalls, ports like 143 and 993 are closed. Try using another network to see if it works. You may need to adjust your router settings to resolve the issue.
3) If you have a network monitor like LittleSnitch installed, it can be blocking the IMAP access. You need to enable it in their admin panel.
4) If you have 2 factor authentication enabled, you need to generate app specific password to get it working.
You can find our other guides here: