Setting up an email app looks simple until you reach the server settings screen. It asks for incoming and outgoing ports, and suddenly you have four numbers to choose from: 993 or 143 for receiving mail, and 465 or 587 for sending it. Pick the wrong pair and your mail either fails to connect or, worse, connects without proper protection.
The good news is that there is a clear modern answer. This guide explains what each port does, why the older options still exist, and which combination you should use in Outlook, Apple Mail, Thunderbird, and on your phone.
Quick Answer
Use IMAP port 993 with SSL/TLS for incoming mail and SMTP port 587 with STARTTLS for outgoing mail. Port 587 is the standard submission port for sending from an email app. If your provider specifically tells you to use port 465 with SSL/TLS, that is also secure and acceptable. Avoid port 143 and any setting with no encryption, because they can expose your password and messages.
What Email Ports Actually Do
A port is like a numbered door on a mail server. Your email app knocks on one door to collect new messages and a different door to hand over messages you want to send. The server only listens on the doors it has been configured to open, so your app and the server must agree on the same numbers.
Two separate jobs are involved:
- Incoming mail: Handled by IMAP (or the older POP3). IMAP keeps your messages stored on the server and syncs them across all your devices, which is what most people want.
- Outgoing mail: Handled by SMTP. When you press Send, your app submits the message to an SMTP server, which then delivers it to the recipient’s provider.
Each job has a secure port and a legacy port. The port number and the encryption setting work as a pair, so changing one usually means changing the other.
IMAP 993 vs 143: Receiving Your Mail
Port 993 — IMAP with SSL/TLS
Port 993 is the secure IMAP port. The connection is encrypted from the very first moment, before your username or password is sent. Everything that follows — your login details, message headers, and the full text of your emails — travels inside that protected tunnel. This is the port every major provider, including Gmail, Microsoft 365, and Yahoo, expects you to use.
Port 143 — Plain IMAP with Optional STARTTLS
Port 143 is the original IMAP port from a time when encryption was optional. A connection on 143 starts in plain text. It can be upgraded to an encrypted connection using a command called STARTTLS, but only if both the app and the server support it and the setting is switched on. If STARTTLS is not used, your password and emails cross the network in readable form. On public Wi-Fi, that is a real risk.
Which IMAP Port Should You Choose?
Choose 993 with SSL/TLS in almost every case. Use 143 only if a provider’s own setup guide tells you to, and then only with STARTTLS selected as the encryption method. Never use 143 with encryption set to None.
SMTP 465 vs 587: Sending Your Mail
Port 587 — Submission with STARTTLS
Port 587 is the official port for message submission — an email app sending mail through your own provider’s server. It requires you to log in with your email address and password, which proves the mail really comes from you. The connection starts plain and is upgraded with STARTTLS before your password is sent, provided you select STARTTLS (or the equivalent option) in your app. Gmail, Outlook.com, and most business mail systems recommend 587.
Port 465 — SMTP with Implicit SSL/TLS
Port 465 has a mixed history. It was briefly assigned for secure SMTP in the 1990s, then officially withdrawn, and for years guides told people not to use it. That changed: modern standards work brought it back as a legitimate option, because like port 993 it encrypts the connection from the very start — a method often called implicit TLS. Several large providers support 465, and some prefer it. Used with SSL/TLS selected, it is just as safe as 587 with STARTTLS.
What About Port 25?
Port 25 is for servers talking to other servers, not for your email app. Most home internet providers block outgoing port 25 to fight spam, and many mail servers refuse unauthenticated mail on it. If an old guide tells you to send on port 25 from Outlook or your phone, ignore it — that advice is decades out of date.
The Recommended Settings at a Glance
- Incoming server: IMAP, port 993, encryption SSL/TLS
- Outgoing server: SMTP, port 587, encryption STARTTLS, authentication required
- Acceptable alternative: SMTP, port 465, encryption SSL/TLS, authentication required
- Avoid: IMAP 143 with no encryption, SMTP 25 from an email app, and any port paired with the wrong encryption type
If you are troubleshooting a broken account, you can compare these values with the steps in our guide to fixing Outlook not receiving emails, which walks through account settings in order.
How to Check and Change Your Ports
- Open your email app and go to the account settings for the address you want to check.
- Find the incoming server section. Confirm the server name matches your provider’s guide, the protocol is IMAP, and the port is 993 with SSL/TLS selected.
- Find the outgoing server (SMTP) section. Set the port to 587 with STARTTLS, or 465 with SSL/TLS if your provider lists that instead.
- Make sure outgoing authentication is turned on and set to use the same username and password as the incoming server.
- Save the settings and send a test message to yourself. Check that it both sends and arrives.
- If the test fails, change only one value at a time and test again, so you know exactly which setting fixed it.
In Microsoft Outlook on Windows, these values live under File, Account Settings, then Server Settings. Microsoft’s own Outlook.com POP, IMAP and SMTP settings reference shows the exact port and encryption combinations for its service, and the same pattern applies to most providers. For Gmail accounts, Google’s help page for reading Gmail in other email clients lists 993 for IMAP and 587 for SMTP, confirming the modern standard.
Why Mismatched Port and Encryption Settings Fail
The most common setup error is pairing a port with the wrong encryption method. Port 993 expects SSL/TLS from the start; if you set it to STARTTLS, the handshake fails. Port 587 expects STARTTLS; if you set it to SSL/TLS, many servers reject the connection. Port 465 expects SSL/TLS, not STARTTLS. When the pairing is wrong, apps show vague errors about being unable to connect or about an unsupported encryption type. Always treat the port and encryption as one matched pair from your provider’s table, not as two separate choices.
Common Mistakes to Avoid
- Using port 143 or 587 with encryption set to None. This can send your password in plain text.
- Guessing the server names. Port numbers are standard, but server names like imap.example.com differ by provider — copy them from the official guide.
- Forgetting SMTP authentication. Without it, servers reject your outgoing mail with relay errors.
- Mixing settings from two providers. A Gmail incoming server cannot be paired with another company’s outgoing server using the same password.
- Assuming 465 is always wrong. Old advice said to avoid it, but with SSL/TLS it is now a valid, secure choice when your provider lists it.
- Changing ports to fix a password problem. If the app asks for your password repeatedly, the password or an app-password requirement is usually the cause, not the port.
Conclusion
The port question has a simple answer for almost everyone: IMAP 993 with SSL/TLS for receiving mail, and SMTP 587 with STARTTLS for sending it. Port 465 with SSL/TLS is a safe alternative when your provider publishes it. What matters most is that the port and encryption method match, authentication is switched on for sending, and you never fall back to unencrypted settings. With those values in place, your email will connect reliably and your password will stay protected on any network.
Frequently Asked Questions
Is port 465 or 587 better for sending email?
Both are secure when configured correctly. Port 587 with STARTTLS is the widely recommended default for email apps. Port 465 with SSL/TLS encrypts from the first moment and is equally safe. Follow whichever one your provider lists in its official settings.
Can I still use IMAP port 143?
Only if your provider requires it and you select STARTTLS as the encryption method. Without STARTTLS, port 143 sends data without protection. For all major providers, port 993 is available and is the better choice.
Why does my email work on Wi-Fi but not on mobile data, or the other way round?
Some networks block certain ports, especially port 25 and occasionally 465. Switching to the standard pair — 993 for incoming and 587 for outgoing — usually fixes network-specific problems, because these ports are almost never blocked.
Do I need different ports for POP3?
Yes. POP3 uses port 995 with SSL/TLS for secure connections and port 110 without encryption. POP3 downloads mail to one device rather than syncing it, so IMAP on port 993 suits most people better.
What does STARTTLS actually do?
STARTTLS is a command that upgrades a plain connection to an encrypted one before sensitive data is exchanged. Your app connects, asks the server to start TLS, and only then sends your password. It is the encryption method paired with ports 143 and 587.


[…] If your outgoing port is set to 25, change it. Port 25 is meant for communication between servers. Home internet providers commonly block it or route it through filters, and receiving servers treat unauthenticated port 25 submissions with suspicion. Many 550 relay errors disappear the moment the app is moved to port 587 with authentication switched on. For background on choosing between the sending ports, see our comparison of SMTP ports 465 and 587 and IMAP ports 993 and 143. […]