“Cannot connect to IMAP server”, “The connection to the server failed” or “IMAP login failed” means your email app (Outlook, iPhone Mail, Thunderbird, Android Gmail, etc.) cannot reach the mail server, or the server rejects your sign-in. The cause is usually a wrong server name or port, the encryption (SSL/TLS) setting, or signing in with a normal password that is no longer accepted.
Quick Checklist
- Try webmail: can you sign in with the same address and password in a browser (Gmail.com, Outlook.com, your hosting webmail)? If not, the problem is the password or the account.
- Server and port: incoming IMAP usually uses port 993 with SSL/TLS. Check your provider in the table below.
- Password type: Gmail, Outlook.com, iCloud and Yandex expect “Sign in with Google” / Microsoft sign-in (OAuth) or an app password in mail apps instead of your normal password.
- Network: try mobile data or another Wi-Fi. Some work, school and hotel networks and security programs block mail ports.
- Re-add the account: if fixing settings doesn’t help, remove the account from the app and add it again. With IMAP your mail stays on the server.
IMAP Server Settings by Provider
| Provider | Incoming (IMAP) | Outgoing (SMTP) | Password |
|---|---|---|---|
| Gmail | imap.gmail.com · 993 · SSL/TLS | smtp.gmail.com · 465 (SSL/TLS) or 587 (STARTTLS) | “Sign in with Google”; otherwise an app password (with 2-Step Verification) |
| Outlook.com / Hotmail | outlook.office365.com · 993 · SSL/TLS | smtp-mail.outlook.com · 587 · STARTTLS | Modern Auth (OAuth2) required; use an app that supports Microsoft sign-in |
| iCloud | imap.mail.me.com · 993 · SSL | smtp.mail.me.com · 587 · SSL/TLS | App-specific password required |
| Yandex | imap.yandex.com · 993 · SSL | smtp.yandex.com · 465 · SSL | Turn on IMAP access in settings and create an app password |
| Your own domain (hosting) email | Server shown in your hosting panel · 993 · SSL/TLS | Server from the panel · 465 · SSL/TLS | The mailbox password; username is the full email address |
These settings come from the official help pages of Google, Microsoft, Apple and Yandex. Since January 2025, IMAP access is always on in Gmail, so there is no setting to enable.
Causes and Fixes
1. Your normal password is no longer accepted
Google says Gmail no longer supports third-party apps or devices that ask for your Google username and password, and recommends “Sign in with Google”. Microsoft states that Outlook.com requires Modern Auth (OAuth2). If an old app or device only asks for a password, the connection is refused and looks like a “can’t connect” error.
- Fix: add the account with the app’s “Google” or “Outlook.com” option instead of manual IMAP. If the app can’t do that, use the provider’s app password option or update the app.
2. Wrong server name, port or encryption
- Use port 993 with SSL/TLS for IMAP. Port 143 is unencrypted or STARTTLS, and many providers don’t accept it.
- The server name must not contain spaces or extras like “https://”.
- With most providers, enter your full email address as the username.
3. Password changed or account locked
If you changed your password on another device, the old one in the app is rejected. After many failed attempts, some servers temporarily block your IP address. Check the password in webmail first, then update it in the app.
4. Network, firewall or antivirus
Corporate networks and the “email scanning” features of some antivirus programs can block ports 993 and 465, or intercept them and cause certificate errors. Try mobile data; if it works there, the network is the problem.
5. Certificate (SSL) error
For hosting email, if you enter a server name that isn’t on the certificate (for example a subdomain without a certificate), the app reports “cannot verify server identity” or a connection error. Use the secure (SSL/TLS) server name your hosting panel recommends, and make sure your device’s date and time are correct.
6. Server outage
If everything is correct and several devices fail at the same time, check your provider’s status page or contact your hosting company.
Fixing It on iPhone
- Go to Settings → Apps → Mail → Mail Accounts (older iOS: Settings → Mail → Accounts).
- For Gmail, Outlook or iCloud, delete the account and add it again with Add Account; the iPhone finds the settings itself and uses secure sign-in.
- For hosting email, choose Add Other Account → Mail Account. If the settings aren’t found, choose IMAP and enter the server names from your hosting panel.
- Under Advanced in the account details, “Use SSL” should be on and the server port should be 993.
- To add iCloud to another app, always use an app-specific password.
Finding Hosting Email Settings (cPanel)
If you use an address on your own domain (name@yourcompany.com), the right settings are in your hosting panel. In cPanel, open Email Accounts and click Connect Devices next to the account. The Set Up Mail Client screen lists the secure SSL/TLS settings, incoming and outgoing server names and ports. Copying these values exactly fixes most errors.
For business email on your own domain, see our cPanel hosting plans.
What Is IMAP?
IMAP (Internet Message Access Protocol) keeps your mail on the server and syncs it between your phone, computer and webmail: what you read or delete on one device looks the same on the others. POP3 usually downloads mail to a single device. If you use more than one device, choose IMAP.
Frequently Asked Questions
What does “IMAP login failed” mean?
The app reached the server but the username or password was rejected. Check the password in webmail; for Gmail, iCloud or Yandex, use an app password or the provider’s sign-in.
Will I lose my email if I remove the account?
With IMAP, mail is stored on the server, so removing and re-adding the account on a device doesn’t delete it. If you use POP3 without leaving a copy on the server, back up the mail on the device first.
Categories
-
CentOS 7 guides
-
cPanel 20 guides
-
CyberPanel 18 guides
-
Operating Systems 81 guides
-
Juniper Networks 18 guides
-
Control Panels 50 guides
-
Linux 17 guides
-
MySQL 29 guides
-
Network 95 guides
-
Plesk Panel 12 guides
-
Virtual Servers 273 guides
-
SEO 3 guides
-
Cyber Security 8 guides
-
Technology 162 guides
-
VMware 36 guides
-
WordPress 20 guides
-
Artificial Intelligence 22 guides