Standard IMAP typically uses port 993 for secure SSL/TLS connections or port 143 for non-secure connections. Using the wrong port—or the wrong encryption method for a specific port—will result in a "Connection Refused" error.
Many providers (like Gmail and Yahoo ) now require OAuth2 or Two-Factor Authentication (2FA) . If you have 2FA enabled, your standard password will no longer work for IMAP; you must generate a unique App Password through your provider's security portal. why-won-t-imap-work
IMAP requires three specific "keys" to open the door: the server address, the port number, and the encryption type. Standard IMAP typically uses port 993 for secure
Even with perfect settings, the "pipeline" between you and the server can be blocked. IMAP email broke Outlook, can't get it working again the port number