Email Ports Reference¶
A quick reference for email server ports and when to use each.
Quick Reference¶
| Protocol | Port | Security | Use |
|---|---|---|---|
| IMAP | 993 | SSL/TLS | Recommended for receiving mail |
| IMAP | 143 | STARTTLS | Legacy, use 993 instead |
| POP3 | 995 | SSL/TLS | Recommended if using POP3 |
| POP3 | 110 | STARTTLS | Legacy, use 995 instead |
| SMTP | 465 | SSL/TLS | Recommended for sending mail |
| SMTP | 587 | STARTTLS | Alternative for sending mail |
| SMTP | 25 | None/STARTTLS | Server-to-server only |
Receiving Email¶
IMAP (Internet Message Access Protocol)¶
IMAP keeps your emails on the server, syncing across all your devices.
| Port | Security | Notes |
|---|---|---|
| 993 | SSL/TLS | Recommended - encrypted from start |
| 143 | STARTTLS | Starts unencrypted, then upgrades |
Use IMAP when:
- You check email on multiple devices
- You want emails to stay on the server
- You need folder syncing
POP3 (Post Office Protocol)¶
POP3 downloads emails to your device and typically removes them from the server.
| Port | Security | Notes |
|---|---|---|
| 995 | SSL/TLS | Recommended - encrypted from start |
| 110 | STARTTLS | Starts unencrypted, then upgrades |
Use POP3 when:
- You only check email from one device
- You want to download and store emails locally
- You have limited server storage
Sending Email¶
SMTP (Simple Mail Transfer Protocol)¶
| Port | Security | Use Case |
|---|---|---|
| 465 | SSL/TLS | Recommended for mail clients |
| 587 | STARTTLS | Standard submission port |
| 25 | None/STARTTLS | Server-to-server only (often blocked) |
Port 465 vs 587:
- Port 465 - Implicit TLS (encrypted from the start)
- Port 587 - Explicit TLS (starts plain, upgrades via STARTTLS)
Both are secure when properly configured. Port 465 is often preferred as it's encrypted immediately.
Port 25:
- Used for server-to-server communication
- Usually blocked by ISPs for home/business connections
- Not for mail client use
Common Configurations¶
Gmail / Google Workspace¶
| Type | Server | Port | Security |
|---|---|---|---|
| IMAP | imap.gmail.com | 993 | SSL/TLS |
| SMTP | smtp.gmail.com | 465 | SSL/TLS |
Microsoft 365 / Outlook.com¶
| Type | Server | Port | Security |
|---|---|---|---|
| IMAP | outlook.office365.com | 993 | SSL/TLS |
| SMTP | smtp.office365.com | 587 | STARTTLS |
Generic / Most Hosts¶
| Type | Server | Port | Security |
|---|---|---|---|
| IMAP | mail.yourdomain.com | 993 | SSL/TLS |
| POP3 | mail.yourdomain.com | 995 | SSL/TLS |
| SMTP | mail.yourdomain.com | 465 | SSL/TLS |
SSL/TLS vs STARTTLS¶
SSL/TLS (Implicit)¶
- Connection is encrypted from the very start
- Uses dedicated ports (993, 995, 465)
- More straightforward security
STARTTLS (Explicit)¶
- Connection starts unencrypted
- Client requests encryption upgrade
- Uses standard ports (143, 110, 587)
- Can fall back to unencrypted if misconfigured
Recommendation: Use SSL/TLS ports (993, 995, 465) when available.
Troubleshooting¶
"Connection refused" or "Cannot connect"¶
- Check you're using the correct port
- Verify the server address is correct
- Ensure your firewall allows the port
- Some ISPs block port 25
"Certificate error"¶
- Server hostname must match certificate
- Use
mail.domain.comnot justdomain.com - Check the certificate hasn't expired
"Authentication failed"¶
- Verify username (often full email address)
- Check password is correct
- Some providers require app-specific passwords
- Ensure your account allows IMAP/POP access
"Connection timed out"¶
- Try a different port
- Check if a firewall is blocking the connection
- Verify the server is online