
The SMTP port you should use to send email from an app, website or mail client is 465 (TLS from the first byte) or 587 (STARTTLS). Port 25 is for server-to-server delivery, and many networks block it. For reading mail, use 993 for IMAP and 995 for POP3. This guide explains where each SMTP port number comes from, which one to pick, and how to test a port from your own computer.
Key takeaways
- Use port 465 or 587 to send mail from an app or mail client. Both require you to log in. Port 25 is for mail servers delivering to each other.
- Use port 993 for IMAP and 995 for POP3. Both encrypt the whole connection. Ports 143 and 110 start in plain text.
- RFC 8314 (2018) says email clients should prefer implicit TLS (465, 993, 995) over STARTTLS. That is why calling 465 "legacy" is out of date.
- Google Cloud and AWS block outbound port 25 to the internet by default. Google Cloud leaves ports 465 and 587 open.
- You can test any mail port with
openssl s_client(macOS, Linux) orTest-NetConnection(Windows PowerShell).
Email ports at a glance
Every number below is from the IANA service name and port number registry, checked 1 October 2026.
| Port | IANA service name | Protocol | Encryption | Used for |
|---|---|---|---|---|
| 25 | smtp | SMTP | Optional STARTTLS | Server-to-server mail relay (RFC 5321) |
| 587 | submission | SMTP submission | STARTTLS | Sending from a mail client or app, login required (RFC 6409) |
| 465 | submissions | SMTP submission | Implicit TLS | Sending from a mail client or app, login required (RFC 8314) |
| 143 | imap | IMAP | STARTTLS | Reading mail, synced across devices (RFC 9051) |
| 993 | imaps | IMAP | Implicit TLS | Reading mail, synced across devices |
| 110 | pop3 | POP3 | STLS | Downloading mail to one device (RFC 1939) |
| 995 | pop3s | POP3 | Implicit TLS | Downloading mail to one device |
Implicit TLS means the encrypted connection starts as soon as you connect. STARTTLS means the connection starts in plain text and the client asks the server to switch to TLS. All of these ports use TCP.
Which SMTP port should you use?
For a mail client (Outlook, Apple Mail, Thunderbird), a WordPress SMTP plugin, a contact form or an app, use one of the two submission ports:
- Port 465 with SSL/TLS. Try this first. RFC 8314 asks clients to connect with implicit TLS "in preference to" connecting to a cleartext port and upgrading with STARTTLS.
- Port 587 with STARTTLS. Use this if 465 is blocked or your provider only offers 587. RFC 8314 says servers and clients should support both during the transition.
Both ports expect you to log in with the mailbox's full email address and password. RFC 6409 says a submission server must, by default, reject a message if the session has not been authenticated.
Don't use port 25 from an app or a home connection. RFC 6409 states that "message relay is unaffected, and continues to use SMTP over port 25", while submission happens "normally over port 587". Port 25 is how one mail server hands mail to the next one, not how your laptop should send.
What about port 2525?
Some email delivery services offer port 2525 as a fallback when other ports are blocked. It is not an email port in the IANA registry: port 2525 is registered to "MS V-Worlds". It only works if your provider tells you it listens there.
Why port 465 is not "legacy"
Many guides call port 465 deprecated. That was true for a while, but it changed in 2018.
- Port 465 was briefly registered as "smtps" and then revoked. Mail software kept using it for encrypted submission anyway, as RFC 8314, Section 7.3 explains.
- RFC 8314 (January 2018) registered port 465 again as submissions, "Message Submission over TLS protocol", to match real-world use.
- The same RFC tells mail apps to prefer implicit TLS for both sending and reading mail.
A similar reversal happened for reading mail. RFC 2595 (1999) said the separate "imaps" and "pop3s" ports were "discouraged in favor of the STARTTLS or STLS commands". RFC 8314 now recommends ports 993 and 995 over the plain-text ports.
IMAP and POP3 ports: 993, 995, 143 and 110
IMAP keeps your mail on the server and syncs folders, read status and sent items across your phone, laptop and webmail. RFC 9051 (IMAP4rev2, which obsoletes RFC 3501) says a server listens on port 143 for cleartext or 993 for implicit TLS. STARTTLS only works on the cleartext port.
POP3 downloads mail to one device. RFC 1939 puts it on TCP port 110 and notes that "normally, mail is downloaded and then deleted" from the server. Port 995 is the TLS version.
Pick IMAP on 993 unless you have a reason to keep mail on one computer only. POP3 on 995 suits a single desktop that archives everything locally.
Port settings in cPanel
If your email is hosted on a cPanel server, the cPanel documentation for Set Up Mail Client lists these settings:
| Setting | Secure SSL/TLS (recommended) | Non-SSL (not recommended) |
|---|---|---|
| Username | Full email address | Full email address |
| Incoming server | mail.example.com | mail.example.com |
| IMAP port | 993 | 143 |
| POP3 port | 995 | 110 |
| Outgoing (SMTP) server | mail.example.com | mail.example.com |
| SMTP port | 465 | 587 |
Use the password for the email account, not your cPanel or computer password. Every WaseerHost hosting plan uses cPanel, so you can find the exact server name for your account under Email Accounts > Connect Devices. If you need mailboxes on your own domain, see WaseerHost business email or cPanel shared hosting.
Why cloud providers and home connections can't use port 25
Port 25 is where mail servers accept mail from other servers without a login, which makes it attractive to spammers. Google Cloud gives the reason in one line: "Due to the risk of abuse". Networks therefore block or distrust outgoing port 25 traffic from machines that are not meant to be mail servers.
- Google Cloud: "connections to destination TCP Port 25 are blocked when the destination is external to your VPC network", and Google "does not place any restrictions" on ports 587 or 465 (Compute Engine docs, updated 28 September 2026).
- AWS: "By default, Amazon EC2 allows outbound traffic over port 25 only to private IPv4 addresses." You can ask AWS to remove the restriction (EC2 service quotas).
- Home connections: Gmail refuses mail from IP ranges that ISPs mark as not authorized to send, such as many consumer broadband ranges. Google's suggested fix is to send through your ISP's relay or your own domain's mail server instead (Gmail Help).
In practice, if your website or app sends mail, point it at your mail provider's server on port 465 or 587 with a username and password.
How to test an SMTP, IMAP or POP3 port
Windows (PowerShell)
Test-NetConnection checks whether a TCP port is reachable (Microsoft Learn):
Test-NetConnection -ComputerName mail.example.com -Port 465
Test-NetConnection -ComputerName mail.example.com -Port 587
Test-NetConnection -ComputerName mail.example.com -Port 993Look for TcpTestSucceeded : True. If it says False, a firewall, your ISP or the server is blocking that port.
macOS and Linux (OpenSSL)
openssl s_client opens a TLS connection and shows the server's greeting (OpenSSL docs). Use -starttls for ports that begin in plain text:
# SMTP, implicit TLS (465)
openssl s_client -connect mail.example.com:465 -crlf -quiet
# SMTP, STARTTLS (587)
openssl s_client -connect mail.example.com:587 -starttls smtp -crlf -quiet
# IMAP, implicit TLS (993)
openssl s_client -connect mail.example.com:993 -crlf -quiet
# POP3, implicit TLS (995)
openssl s_client -connect mail.example.com:995 -crlf -quietA working server answers with its greeting (on port 587, OpenSSL reads the greeting itself before switching to TLS, so type EHLO example.com and expect lines starting with 250):
- SMTP: a line starting with
220, for example220 mail.example.com ... Service ready(RFC 5321) - IMAP: a line starting with
* OK - POP3: a line starting with
+OK
Type QUIT (SMTP), a LOGOUT (IMAP) or QUIT (POP3) and press Enter to close the session. Run the commands without -quiet if you also want to see the certificate chain.
If the test fails
- Timeout: the port is blocked on your network or the server is not listening. Try the other submission port (465 or 587), or test from a different network such as a phone hotspot.
- Connection refused: the server is reachable but nothing listens on that port. Check the port number your provider documents.
- Certificate name mismatch: use the server hostname your provider gives you, not your own domain, unless the certificate covers it.
- Connects but login fails: use the full email address as the username and the mailbox password.
Frequently asked questions
Use 587 (or 465) to send from a mail client, website or app. Port 25 is for mail servers relaying to each other, and RFC 6409 keeps relay on port 25 while submission normally uses 587. Port 25 is also blocked by default for internet destinations on Google Cloud and AWS.

Written by
Founder & CEO
Founder and CEO of Wasevo LLC, the company that runs WaseerHost. He works on cPanel/WHM servers, WHMCS billing and the Next.js storefront.

