Your mail app can’t reach the IMAP/SMTP server because the network, sign-in, or server settings aren’t matching what the provider accepts.
You open your inbox, hit refresh, and get that blunt message: “Connection to the server failed.” It feels like your email just fell off the internet. The good news is this error is usually one of a small set of problems, and you can narrow it down fast without guessing.
This guide walks you through a clean triage: first you confirm it’s not a provider outage, then you test your connection, then you verify the settings your app is using, and last you fix the account sign-in rules that often block older mail apps. Each step is short, practical, and meant to get you back to sending and receiving mail.
What That Error Means In Plain Terms
Email apps don’t magically “find” your mailbox. They connect to specific servers using specific ports, then authenticate, then sync messages. When your device says the connection failed, one of these moments broke:
- Network reachability: your device can’t reach the server address at all (Wi-Fi issues, DNS problems, captive portals, VPN blocks).
- Encryption handshake: the app and server disagree about TLS/SSL settings or certificates.
- Authentication: the password is wrong, the provider wants an app password, or the account requires a newer sign-in method.
- Server/port mismatch: the app is trying the wrong hostname, wrong port, or wrong protocol (IMAP vs POP).
- Provider-side limits: temporary blocks, rate limits, or a mailbox service outage.
Start With A 2-Minute Triage
Before you edit settings, do two quick checks. They save time and stop you from “fixing” the wrong thing.
Check If The Provider Is Down
If Gmail, Outlook, iCloud, or your hosting mail server is having a bad day, every device will struggle. Try webmail in a browser. If webmail won’t load or won’t sign in, you’re done for now: it’s not your phone, it’s upstream.
If webmail works, move on. That points back to your device, your app, or the account configuration.
Try A Different Network
Switch from Wi-Fi to cellular data, or hop onto a different Wi-Fi. If the error disappears, your original network is the trigger. Captive portals (hotel Wi-Fi), router DNS issues, and VPN profiles are common culprits.
Fix The Most Common Connection Blockers
Clear Captive Portals And “Sign In To Wi-Fi” Screens
Public Wi-Fi often requires you to accept terms in a browser first. Your email app won’t pop that screen for you. Open a browser, load any plain website, and finish the sign-in page. Then retry email sync.
Turn Off VPN And Test Again
VPNs can break mail in two ways: they can block the mail ports, or they can route you through an IP range that your provider distrusts for sign-in. Disable the VPN, refresh email, then decide whether to change VPN regions or use split tunneling for your mail app.
Restart The Simple Stuff That Actually Works
It sounds basic, but it’s effective when the network stack is stuck.
- Toggle Airplane Mode on, wait 10 seconds, toggle it off.
- Restart the device.
- Reboot the router if the problem is only on one Wi-Fi network.
Watch For Time And Date Drift
TLS security checks rely on accurate time. If your device time is wrong by a lot, encrypted connections can fail. Set date and time to automatic, then retry.
Confirm You’re Using The Right Server Type
Many people inherit an old setup: POP on one device, IMAP on another, and a custom SMTP server that no longer exists. If you care about email syncing across devices, IMAP is usually the right choice. POP can still work, but it often creates “email is missing on one device” problems and can be touchy on mobile networks.
Know The Three Roles
- Incoming mail: IMAP (most common) or POP (older style).
- Outgoing mail: SMTP (sending).
- Account security: password rules, app passwords, and sign-in approvals.
If your error happens only when sending mail, your incoming settings may be fine and the SMTP side is broken. If you can’t receive either, start with incoming settings and sign-in.
Why Does My Email Say Connection to the Server Failed?
That message shows up when your app tries to connect and can’t complete a successful login session. The fastest way to fix it is to match the provider’s expected server address, port, and security method, then confirm the account’s sign-in rules allow that app to connect.
Check Credentials And Sign-In Rules First
Re-Enter The Password Carefully
Yes, it’s obvious. It’s still worth doing. Password managers sometimes paste a trailing space, and some apps silently keep an older password even after you changed it on the web.
Look For App Password Requirements
Many providers block basic sign-in for accounts with two-step sign-in enabled unless you use an app password. If your password is correct but the app refuses to connect, this is a prime suspect.
Check For Security Alerts In Webmail
Sign in through a browser and look for notices like “new sign-in blocked” or “confirm it’s you.” Approve it, then retry the mail app. This is common after travel, VPN use, or a brand-new phone.
Common Symptoms And What They Point To
The error message is vague, so your best clue is what else you see around it. Use this mapping to pick the next step instead of trying random tweaks.
If you only get the error at home Wi-Fi, look at router DNS, VPN, or blocked ports. If it fails on all networks, it’s more likely a settings or sign-in issue. If it fails only for sending, it’s usually SMTP settings or authentication.
Fast Diagnosis Table
This table helps you match what you’re seeing to the most likely cause and the next check that saves time.
| What You Notice | Most Likely Cause | Next Check |
|---|---|---|
| Webmail works, app fails | Wrong server/port or app blocked by sign-in rules | Verify IMAP/SMTP settings, then check app password needs |
| Fails only on one Wi-Fi | Captive portal, DNS issue, VPN, or router filtering | Open a browser to clear Wi-Fi sign-in, then test on cellular |
| Receiving works, sending fails | SMTP auth or port mismatch | Confirm SMTP server, port, and “requires authentication” is on |
| Error after password change | Stored password is outdated | Remove and re-add the account, or re-enter credentials |
| Error after enabling 2-step sign-in | Needs app password or modern auth | Create an app password (if supported) and update the mail app |
| Works, then stops after heavy syncing | Rate limit or temporary block | Wait a bit, reduce sync frequency, check provider security alerts |
| “Cannot verify server identity” appears | TLS certificate mismatch or interception | Disable VPN, check device date/time, confirm correct hostname |
| Only one device fails, same account | Device/app configuration issue | Update the mail app/OS, then remove and re-add the account |
| All devices fail at once | Provider outage or account lock | Test webmail, then check provider status and security notices |
Verify Server Settings The Right Way
This is where most “connection failed” problems get solved. The trick is to avoid copying settings from a random blog post. Use the provider’s published settings for your exact service.
Gmail And Google Workspace Accounts
For Gmail-family accounts, incoming IMAP is typically imap.gmail.com on port 993 with SSL/TLS. Outgoing SMTP is typically smtp.gmail.com465 (SSL) or 587 (TLS/STARTTLS). If you want the official values in one place, use this Google reference: IMAP, POP, and SMTP settings for Gmail.
If your Gmail account uses two-step sign-in, you may need an app password depending on the app. Newer apps often handle modern sign-in on their own. Older apps can fail with a generic connection error because they never reach a successful authentication step.
Microsoft Outlook, Microsoft 365, And Exchange Accounts
Microsoft accounts can be configured through different connection types: classic IMAP/SMTP, Exchange, or modern Outlook sign-in. If you see repeated connection issues in Outlook, Microsoft flags two usual causes: outdated software and a corrupted profile. Their troubleshooting flow is here: Fix Outlook connection problems in Microsoft 365.
On mobile, “remove account and add it again” sounds annoying, but it often forces a clean profile rebuild and refreshes the sign-in token. If the account is Exchange/Work email, your admin may require device approval or conditional access rules that block older mail apps.
Custom Domain Email (Web Hosting, cPanel, ISP Mail)
Custom-domain mail is where settings get messy. You might have:
- One server name for incoming mail and a different one for outgoing mail.
- A host that changed mail servers during a migration.
- A provider that blocks port 25 for sending to fight spam.
Your hosting panel usually lists the exact incoming and outgoing settings. If you can’t find them, webmail often shows the server names under “configure mail client” options.
Ports, Security, And The “Right” Encryption Choice
Ports look like boring numbers until the wrong one breaks everything. Here’s the simple mental model:
- IMAP with SSL commonly uses 993.
- POP with SSL commonly uses 995.
- SMTP submission commonly uses 587 (STARTTLS) or 465 (SSL), depending on the provider.
If your app offers choices like “SSL/TLS,” “STARTTLS,” or “None,” pick the one your provider documents. If you guess, you can end up stuck at “connection failed” because the server refuses insecure logins or the app tries to encrypt on a port that expects plain text first.
Port And Security Settings Cheat Sheet
Use this table as a quick cross-check when your app shows dropdowns for protocol, port, and security. You still want to match your provider’s published values, but this helps you spot obvious mismatches.
| Connection Type | Common Port | Common Security |
|---|---|---|
| IMAP (incoming) | 993 | SSL/TLS |
| POP (incoming) | 995 | SSL/TLS |
| SMTP submission (outgoing) | 587 | STARTTLS/TLS |
| SMTP over SSL (outgoing) | 465 | SSL/TLS |
| Legacy SMTP relay | 25 | Varies by server |
Device And App Fixes That Beat “Connection Failed” Loops
Update The Mail App And Your OS
Mail providers tighten security. Older apps can fall behind and fail sign-in in ways that look like a network error. Update the mail app, then update the operating system if you’re several versions back.
Remove The Account And Add It Back Cleanly
If settings are half-right and half-wrong, you can chase your tail for an hour. Removing the account clears saved tokens and cached server routes. When you add it back, pick the provider-specific option (Gmail, Outlook, iCloud, Exchange) instead of “Other” when possible.
Rebuild A Corrupted Profile (Desktop Outlook)
On Windows, Outlook profiles can get corrupted after add-ins, upgrades, or account changes. A new profile often fixes a stubborn connection error that survives password changes. If the issue started after an Office update or a crash, this step is worth the time.
Check Firewall Or Security Software (Desktop)
Security software can block mail ports or intercept encrypted connections. If the error is only on one computer, temporarily disable the security tool to test, then add rules that allow the mail app to connect. Turn protection back on after you test.
When It’s Not You: Provider Blocks And Rate Limits
Mail servers can temporarily block you after too many failed logins, too many connection attempts, or a suspicious IP change. It can look like a server outage from your side. If you’ve tried the correct password and settings, pause for a bit, then try again from a clean network.
If you manage a domain server, check server logs for authentication failures and connection rejections. If you’re a user on a work account, ask your admin if conditional access policies are blocking the app you’re using.
One Clean Workflow That Fixes Most Cases
If you want one reliable path, do this in order:
- Test webmail in a browser. If it fails, stop and wait for service recovery or account unlock.
- Switch networks (Wi-Fi to cellular). If it works, fix the network (portal, VPN, router DNS).
- Confirm the provider’s server names, ports, and security settings in your app.
- Re-enter credentials. If two-step sign-in is enabled, use the provider’s supported app sign-in method.
- Remove the account and add it back using the provider-specific setup option.
By the time you finish step five, most “connection failed” errors are gone. If it still fails after that, the remaining cases tend to be admin policies, server-side blocks, or a mis-issued certificate on the mail server.
References & Sources
- Google Workspace Developers.“IMAP, POP, and SMTP settings for Gmail.”Lists Gmail server addresses, ports, and TLS/SSL requirements used by email clients.
- Microsoft Learn.“Fix Outlook connection problems in Microsoft 365.”Outlines common Outlook connection failure causes and remediation steps like updates and profile fixes.
