SMTP and IMAP ports explained: 25, 465, 587, 143, 993

Which email port to use and why: 25 vs 465 vs 587 for sending, 143 vs 993 for receiving, and what to check when your email app can't connect.

4 min read

Email settings screens ask for a port number as if everyone memorised them. You didn't, and you shouldn't have to. There are really only two answers to remember. Everything else on this page is for when a port refuses to cooperate.

The two answers

For a normal mailbox on a service like Mailions:

  • Sending (SMTP): port 587, security STARTTLS.
  • Receiving (IMAP): port 993, security SSL/TLS.

Username is your full email address. Password is the mailbox password. Everything else on this page explains the exceptions.

Sending: SMTP ports

SMTP is the protocol that moves mail. Three ports are in common use, and they do different jobs.

Port 25: server to server

Port 25 is how mail servers pass messages to each other. It's not meant for people. Most home internet providers and cloud hosts block outgoing port 25 on purpose, to stop infected computers from sending spam. If your app can't send on port 25, that's usually a block, not a bug. Don't fight it. Use 587.

Port 587: submission

Port 587 is for email clients and apps handing mail to their own server. The connection starts unencrypted, then the client issues STARTTLS to upgrade to an encrypted one before logging in. This is the standard answer, and the one Mailions uses.

Port 465: implicit TLS

Port 465 encrypts from the first byte, with no upgrade step. It was assigned, withdrawn and later reinstated for this purpose, which is why older documentation is confusing about it. Some providers support it. When a service lists 587, use 587.

PortUsed forEncryptionUse it?
25Server to serverOptionalNot from clients
465Client submissionTLS from the startOnly if your provider says so
587Client submissionSTARTTLSYes, the default

Receiving: IMAP and POP3 ports

IMAP keeps your mail on the server and shows it on every device, so reading, deleting and moving messages stays in sync. POP3 downloads messages to one device. The short version: choose IMAP unless you have a specific reason not to.

PortProtocolEncryption
143IMAPSTARTTLS
993IMAPSSL/TLS from the start
110POP3STARTTLS
995POP3SSL/TLS from the start

Use 993. It encrypts from the first byte, so there's no moment where a password could travel in the clear.

What "SSL/TLS" and "STARTTLS" mean in the dropdown

Email apps label the security setting with names that aren't consistent. Roughly:

  • SSL/TLS or SSL: encrypted from the start. Pair with 993 for IMAP.
  • STARTTLS or TLS: begins plain, then upgrades. Pair with 587 for SMTP.
  • None: unencrypted. Never choose it for anything with a password.

If the app has one dropdown that only says "TLS" for SMTP on port 587, that's STARTTLS. WordPress's WP Mail SMTP plugin labels it that way.

When it won't connect

Work through the symptoms in this order.

"Connection timed out." The port is blocked between you and the server. Try another network, such as your phone's hotspot. If it works there, your office or home network is filtering it.

"Authentication failed" or "Login incorrect." Check three things: the username must be the whole address ([email protected], not info), the password must be the mailbox password rather than your panel password, and there are no stray spaces if you pasted it.

A certificate warning. The server name in the app has to match the name on the server's certificate. Use the hostname your provider gives you, not your own domain, unless they tell you otherwise. The mailbox setup guide shows the exact hostname for Mailions.

It receives but won't send. Incoming and outgoing settings are separate. Check the SMTP server entry on its own, and make sure "authentication required" is on.

It sends but the message lands in spam. That's not a port problem. Check that SPF, DKIM and DMARC pass. Start with what an SPF record is.

What about apps running on a server?

A website or script that sends mail follows the same rule as an email app: authenticate on 587 with STARTTLS. The twist is that cloud hosts sometimes block outgoing SMTP ports from new accounts, so a script that works on your laptop fails once deployed. If you hit that wall, an HTTP API sidesteps it, because the request travels over ordinary HTTPS on port 443, which nobody blocks.

A quick test with no email app

If you're comfortable in a terminal, openssl tells you whether the server answers:

openssl s_client -connect mail.example.com:993
openssl s_client -starttls smtp -connect mail.example.com:587

A certificate and a greeting line mean the port is reachable. Silence or a timeout means something is blocking it.

Put it to use

Set up a mailbox and try it: professional email on your own domain walks through the whole process, and phone setup covers the apps. To get a mailbox on your own domain, contact us.