Email ports: IMAP, POP3 and SMTP port numbers
A port is the numbered "door" a mail app uses to talk to a mail server. Get it wrong and the app can't connect. Here are the standard numbers for IMAP, POP3 and SMTP, and which ones to pick.
IMAP: port 993 (SSL/TLS). Port 143 is the older unencrypted port. POP3: port 995 (SSL/TLS); 110 is unencrypted. SMTP for sending: port 465 (SSL/TLS) or 587 (STARTTLS). Port 25 is for server-to-server mail, not your mail app. If your provider lists different settings, use theirs.
See also: Background: what is SMTP?
Email ports at a glance
| Port | Protocol | Used for | Encryption | Use it? |
|---|---|---|---|---|
| 993 | IMAP | Reading mail (keeps it on the server) | TLS from the start ("SSL/TLS") | Yes, first choice for incoming |
| 143 | IMAP | Reading mail | Plain, can upgrade with STARTTLS | Only if your provider says so |
| 995 | POP3 | Downloading mail to one device | TLS from the start ("SSL/TLS") | Yes, if you need POP |
| 110 | POP3 | Downloading mail | Plain, can upgrade with STARTTLS | Avoid |
| 465 | SMTP submission | Sending from a mail app | TLS from the start ("SSL/TLS") | Yes |
| 587 | SMTP submission | Sending from a mail app | Starts plain, upgrades with STARTTLS | Yes |
| 25 | SMTP relay | Mail servers passing mail to each other | Optional STARTTLS | No, not for mail apps |
These numbers come from the internet standards: RFC 9051 for IMAP, RFC 1939 for POP3, RFC 6409 for port 587, and RFC 8314 for the encrypted ports 993, 995 and 465.
IMAP ports: 993 and 143
IMAP is how most mail apps read email today. It keeps your messages on the server, so your phone, laptop and webmail all show the same inbox. The IMAP standard says a server listens on port 143 (cleartext) or port 993 (implicit TLS).
Pick 993 with SSL/TLS. It's encrypted from the first byte. Port 143 starts unencrypted and relies on a STARTTLS upgrade, so only use it if your provider specifically tells you to.
POP3 ports: 995 and 110
POP3 is the older way to collect mail. The POP3 standard (RFC 1939) says "normally, mail is downloaded and then deleted" from the server. That's why POP is a poor fit if you read mail on more than one device. It's still handy for keeping an offline copy, or for pulling mail from one account into another.
The standard POP3 port is 110. The encrypted version, 995, is the one to use. Not sure which protocol to pick? Choose IMAP. Our webmail vs email apps guide explains the difference.
SMTP ports: 465, 587 and 25
SMTP is how mail is sent. There are three ports, and they're not interchangeable:
- 587 is the "submission" port. RFC 6409 reserves it for email submission: your mail app handing a new message to your provider. It starts plain and upgrades to encryption with STARTTLS. You'll need to sign in.
- 465 is also for submission, but encrypted from the start. It has a messy history: it was used for this years ago, dropped, and then formally assigned to "message submission over TLS" in 2018 by RFC 8314. That RFC now recommends implicit TLS (465) over STARTTLS, while saying servers should support both for now.
- 25 is for servers relaying mail to each other. RFC 6409 notes that relay "continues to use SMTP over port 25." Many internet providers block outgoing port 25 from home connections to cut down on spam, so a mail app set to 25 often just times out.
Which to choose, 465 or 587? Either works with almost every provider. If one fails, try the other. The difference between the two kinds of encryption is explained in TLS vs STARTTLS.
How the settings look in a mail app
Most apps ask for the same few things. Here is a typical IMAP setup:
| Setting | Incoming (IMAP) | Outgoing (SMTP) |
|---|---|---|
| Server | imap.yourprovider.com | smtp.yourprovider.com |
| Port | 993 | 465 or 587 |
| Security | SSL/TLS | SSL/TLS (465) or STARTTLS (587) |
| Username | Your full email address | Your full email address |
| Password | Your password or an app password | Same as incoming |
Server names vary by provider. Look yours up in our email server settings for 24 providers, or see Gmail SMTP settings for Gmail in particular. Some providers, including Gmail, now prefer a "Sign in with Google" option in the app or an app password instead of your normal password.
Troubleshooting connection errors
- "Cannot connect to server" or a timeout: check the port and security pair above. If you're on port 25, switch to 587 or 465.
- Sending works at home but not at a hotel or office: that network may block a port. Try the other submission port.
- "Authentication failed": the port is fine; the sign-in is the problem. You may need an app password, or to turn on IMAP or SMTP access in the provider's settings.
- Certificate warnings: make sure the server name matches exactly what your provider lists.
- Mail sends but bounces: that's not a port problem. Decode the bounce with our SMTP error codes list.
Want to see a full sending session step by step? Read the SMTP conversation explained.
Questions people ask
- What is the IMAP port?
- IMAP uses port 993 with SSL/TLS encryption. Port 143 is the older unencrypted port that can be upgraded with STARTTLS.
- What is the POP3 port?
- POP3 uses port 995 with SSL/TLS, or port 110 without encryption.
- What is the SMTP port, 465 or 587?
- Both are for sending from a mail app. 465 is encrypted from the start (SSL/TLS) and 587 upgrades with STARTTLS. Either works with most providers.
- Should I use port 25 for sending email?
- Not from a mail app. Port 25 is for mail servers relaying to each other, and many internet providers block it from home connections.
- Which port is most secure?
- The implicit TLS ports, 993 for IMAP, 995 for POP3 and 465 for SMTP, are encrypted from the first byte. RFC 8314 recommends them over STARTTLS.