When your email app shows "cannot get mail: the connection to the server failed," it means your device cannot establish a secure, authenticated connection to your email provider's mail server. This is usually due to incorrect server settings, network issues, outdated app credentials, or temporary server downtime. The fix involves verifying your network, checking account settings, updating credentials, and ensuring your app and device are current.
What You'll Need
- Access to your email account via a web browser (to verify login and settings)
- Your email address and password
- Wi-Fi or mobile data connection
- Time to check and re-enter account settings (5–15 minutes)
Step-by-Step
- Confirm your internet connection. Open a web browser and visit a site like google.com. If it loads, your internet is working. If not, restart your router or switch to a different network (e.g., from Wi-Fi to mobile data).
- Log in to your email via a web browser. Go to your provider’s webmail (e.g., mail.google.com for Gmail, outlook.com for Microsoft accounts, apple.com/icloud for iCloud). Enter your credentials. If you can’t log in, the issue is likely your password or account security (like 2FA), not the app. Reset your password or resolve security alerts first.
- Check for app updates. Open your device’s app store (Apple App Store or Google Play). Search for your email app (e.g., Mail, Outlook, Apple Mail). Tap Update if available. Outdated apps often fail to connect due to deprecated security protocols.
- Restart your device. Power off your phone, tablet, or computer completely, wait 30 seconds, then power it back on. This clears temporary glitches affecting network connections.
- Sign out and back into your email account in the app. In your mail app, go to Settings > Accounts (or Mail > Accounts on macOS). Select your account and choose Sign Out or Remove Account. Then add it again using the app’s "Add Account" option. When prompted, enter your email address and password. If your provider requires an app-specific password (e.g., Gmail with 2FA), generate one from your account security settings and use that instead of your regular password.
- Manually verify IMAP/POP and SMTP settings. If automatic setup fails, configure manually. For most providers, use these standard ports:
- Gmail: IMAP: imap.gmail.com (port 993, SSL/TLS), SMTP: smtp.gmail.com (port 465, SSL/TLS). Requires "Less secure app access" disabled and app password if 2FA is on.
- Outlook/Hotmail: IMAP: outlook.office365.com (port 993, SSL/TLS), SMTP: smtp.office365.com (port 587, STARTTLS).
- iCloud: IMAP: mail.icloud.com (port 993, SSL/TLS), SMTP: smtp.mail.icloud.com (port 587, STARTTLS).
- Check firewall or antivirus settings. On Windows, open Windows Security > Firewall & network protection > Allow an app through firewall. Ensure your mail app is checked for Private and Public networks. On macOS, go to System Settings > Network > Firewall > Firewall Options and confirm the mail app is allowed. Temporarily disable third-party antivirus to test if it’s blocking the connection.
- Verify date and time settings. Incorrect system time breaks SSL/TLS encryption. On iPhone: Settings > General > Date & Time > Set Automatically. On Android: Settings > System > Date & Time > Automatic date & time. On Windows: Settings > Time & Language > Date & Time > Set time automatically. On macOS: System Settings > General > Date & Time > Set date and time automatically.
Common Mistakes
- Using the wrong password: Many users enter their regular password when 2FA requires an app-specific password (especially for Gmail, iCloud, and Microsoft accounts).
- Ignoring port numbers: Entering port 587 for IMAP instead of 993, or vice versa, will cause connection failures.
- Disabling SSL/TLS: Some apps default to “None” or “STARTTLS” for IMAP, but most servers require SSL/TLS for port 993.
- Not restarting after updates: App updates often require a full app relaunch or device restart to apply connection fixes.
- Using public Wi-Fi without authentication: Hotels or cafes sometimes block mail ports (e.g., 465, 587). Try switching to mobile data.
Tips
- Test one account at a time. If you have multiple accounts in the app, remove them all except the failing one to isolate the issue.
- Use the provider’s official app (e.g., Gmail, Outlook) instead of the generic mail app. They handle authentication and updates more reliably.
- Check your provider’s service status page. For example, Google Workspace status (https://www.google.com/appsstatus) or Microsoft 365 Admin Center. If there’s an outage, wait for resolution.
- On iOS, go to Settings > Mail > Accounts > [Account] > Advanced and verify SMTP server settings under "Outgoing Mail Server (SMTP)." Sometimes only the primary SMTP is misconfigured.
- For Microsoft accounts, ensure your account hasn’t exceeded storage. If your Outlook.com inbox is full (over 55 GB), syncing may fail.
Troubleshooting
If the connection error persists after following all steps above, try these deeper checks:
- Test on another device. Add the same account to a different phone or computer. If it works, the issue is device-specific (e.g., corrupted app data, outdated OS). If it fails everywhere, the problem is account-wide (e.g., password, 2FA, or provider-side block).
- Check for account locks. Some providers (like iCloud or Outlook) temporarily lock accounts after repeated failed logins. Log in via browser and check for security notifications or unlock prompts.
- Reset network settings. On iPhone: Settings > General > Transfer or Reset iPhone > Reset > Reset Network Settings (this deletes saved Wi-Fi passwords). On Android: Settings > System > Reset > Reset Wi-Fi, mobile & Bluetooth. This clears DNS caches and resets all network configurations.
- Reinstall the email app. Uninstall the app, restart your device, then reinstall from the official store. On Windows, use Settings > Apps > Mail and Calendar > Advanced Options > Reset. If using macOS Mail, try creating a new user account and importing settings there to test if the issue is profile-specific.
- Enable debug logging (advanced). For Outlook desktop (Windows), go to File > Office Account > About Outlook > Diagnostics > Enable Logging. Then reproduce the error and check the logs at %localappdata%\Microsoft\Outlook. This is for technical users only.
Warning: Resetting network settings or reinstalling apps will not delete your emails stored on the server, but locally cached emails may be re-downloaded. Back up important data first if unsure.
Frequently Asked Questions
Why does my email app say "connection to server failed" only on Wi-Fi but not mobile data?
Your Wi-Fi router or network may be blocking mail server ports (e.g., 465, 587, 993). Try changing your router’s DNS to Google’s public DNS (8.8.8.8 and 8.8.4.4) or connect through a VPN. Some public networks (like coffee shops) intentionally restrict email traffic to prevent spam.
Can a weak signal cause this error?
Yes. A spotty or intermittent connection can fail to complete the TLS handshake, triggering the error. Move closer to your router, restart your router, or switch to a wired Ethernet connection if possible.
Does this error mean my email password is wrong?
Not necessarily. While an incorrect password is a common cause, the error can also stem from outdated certificates, SSL issues, or firewall blocks. However, if you can’t log in via webmail, your password is likely the issue.
Why does the connection work for sending but not receiving mail?
This usually means your SMTP (outgoing) settings are correct, but IMAP/POP (incoming) settings are wrong. Double-check the IMAP server hostname, port (993), and SSL setting. Some providers require different credentials for incoming vs. outgoing (e.g., iCloud needs your full email as the username for IMAP).
How long does it take for provider-side changes (like 2FA updates) to affect my app?
Most providers enforce changes immediately. If you enabled 2FA yesterday and your app stopped working today, generate a new app-specific password and re-enter it in the app. There’s no delay—apps must use the updated credentials.
Is there a way to force the app to reconnect without restarting?
Yes. In most apps, pull down on the inbox list to manually refresh. If that fails, toggle Airplane Mode on and off (or restart Wi-Fi). This forces the app to renegotiate the network connection.