What Is SMTP? Ports 25, 465 and 587 Explained Simply
SMTP is the protocol that sends email from your app and between servers. Learn what SMTP is, what ports 25, 465 and 587 mean, and which one your mail app needs.
SMTP (Simple Mail Transfer Protocol) is the standard used to send email. Your mail app uses SMTP to hand a message to your provider, and your provider uses SMTP again to deliver it to the recipient server. The three port numbers you see in settings screens each serve a different role: 25 for server-to-server transfer, 587 for authenticated submission from apps, and 465 for submission over an implicit TLS connection.
Quick summary
- Port 25: the original SMTP port, used by mail servers talking to each other. Most home ISPs and cloud providers block outbound 25 to stop spam bots, so it is unusable for mail apps.
- Port 587: the submission port for authenticated clients. The connection starts in plain text and upgrades to encryption with the STARTTLS command. This is what OquMail and nearly every provider recommend.
- Port 465: submission over implicit TLS, meaning the connection is encrypted from the first byte. Once deprecated, later re-standardised. Fine where offered, but OquMail uses 587.
- From a terminal, run openssl s_client -starttls SMTP (the standard way computers hand off outgoing email) -connect mail.oqumail.com:587 and watch for the 220 banner and a successful TLS handshake.
- Type EHLO test.local and confirm the reply lists STARTTLS and AUTH.
How an SMTP session works
An SMTP conversation is a short text dialogue. The client connects, the server greets it with a 220 banner, the client says EHLO, they optionally upgrade to TLS with STARTTLS, the client authenticates, then sends MAIL FROM, RCPT TO and DATA, and the server answers each with a numeric code. 250 means accepted, 4xx means try again later, 5xx means rejected permanently. Those codes are what you see in bounce messages and in delivery logs.
The three ports side by side
- Port 25: the original SMTP port, used by mail servers talking to each other. Most home ISPs and cloud providers block outbound 25 to stop spam bots, so it is unusable for mail apps.
- Port 587: the submission port for authenticated clients. The connection starts in plain text and upgrades to encryption with the STARTTLS command. This is what OquMail and nearly every provider recommend.
- Port 465: submission over implicit TLS, meaning the connection is encrypted from the first byte. Once deprecated, later re-standardised. Fine where offered, but OquMail uses 587.
Example: OquMail outgoing settings
SMTP server: mail.oqumail.com
Port: 587
Security: STARTTLS
Auth: required, username = full email address
Password: your OquMail webmail passwordHow to test an SMTP server
- From a terminal, run openssl s_client -starttls SMTP (the standard way computers hand off outgoing email) -connect mail.oqumail.com:587 and watch for the 220 banner and a successful TLS handshake.
- Type EHLO test.local and confirm the reply lists STARTTLS and AUTH.
- In a mail app, send a message to yourself and check the Sent folder and the inbox.
- In the OquMail dashboard, open the delivery log for the message to see the exact response the remote server returned.
Common SMTP mistakes
- On port 587 choose STARTTLS, not SSL/TLS. Picking SSL on 587 is the single most common setup mistake and it makes sending silently fail.
- Trying port 25 from a laptop or a cloud server and getting a connection timeout because the network blocks it.
- Entering only the part before the @ as the username. SMTP auth needs the full email address.
- Turning off authentication. Modern providers never relay unauthenticated mail on 587.
- Sending application mail through a personal mailbox password. Use the send API with an API key instead so a rotated password does not break your app.
SMTP and OquMail
OquMail offers SMTP on port 587 with STARTTLS for mail apps, and a separate HTTPS send API for software. The API needs no ports or TLS choices: a POST to https://api.oqumail.com/api/v1/emails with a Bearer API key and a JSON body of from, to, subject and html. Both paths sign with your DKIM key and both record a delivery log per message, so you can see the SMTP response code from the receiving side.
Common questions
Is SMTP only for sending?
Yes. SMTP moves mail toward its destination. Reading mail from your mailbox uses IMAP or POP3.
Why do I need a password for SMTP but not for receiving mail from others?
Servers accept mail for their own domains from anyone on port 25, because that is how the internet delivers to you. Sending on your behalf requires proof it is you, which is why port 587 demands authentication.
Can I use SMTP from my website contact form?
You can, but the OquMail API is simpler for code: no TLS negotiation, no port choice, and a clear JSON response.
Free business email on your own domain
OquMail gives you up to 15 mailboxes on your domain — free — with guided SPF/DKIM/DMARC, webmail, IMAP/SMTP for any mail app, and a send API. Most teams are live in under fifteen minutes. Start at oqumail.com.
Get started free