guides
Best SMTP Port: 25 vs 465 vs 587 vs 2525
Compare SMTP ports 25, 465, 587, and 2525. Learn which SMTP port to use for app sending, relay, STARTTLS, implicit TLS, and MailSlurp validation.
The best SMTP port for most application sending is port 587 with STARTTLS and SMTP AUTH. Use port 465 when your provider requires implicit TLS, port 2525 as a provider-supported fallback, and port 25 mainly for server-to-server relay.
MailSlurp helps teams validate that choice with SMTP diagnostics, private inboxes, received-message assertions, header checks, and deliverability testing.
What is an SMTP port?
SMTP stands for Simple Mail Transfer Protocol. An SMTP port is the TCP port your app, email client, or mail server uses to submit or relay email.
The port number is only one part of the setup. You also need the correct TLS mode, authentication method, sender identity, and receive-side validation.
SMTP port quick answer
| Port | Best use | TLS mode | Use for app sending? |
|---|---|---|---|
25 |
Server-to-server relay | Opportunistic or policy-specific STARTTLS | Usually no |
465 |
Authenticated submission | Implicit TLS from connection start | Yes, when provider requires it |
587 |
Authenticated submission | STARTTLS after connection | Yes, most common default |
2525 |
Alternate submission | Provider-specific, often STARTTLS | Yes, when provider supports it |
If your app sends signup, password reset, OTP, invite, billing, or notification email, start with 587 and STARTTLS unless your provider says otherwise.
Port 25: relay between mail servers
Port 25 is the traditional SMTP relay port used between mail servers. It is still important for mail transfer, but it is usually not the right first choice for application submission.
Many cloud providers, ISPs, and corporate networks restrict outbound 25 to reduce abuse. If an app server cannot connect on 25, the issue may be network policy rather than broken SMTP credentials.
Use port 25 when:
- you are operating a mail server relay path
- the provider documents
25for that relay scenario - the environment allows it
- sender authentication and abuse controls are already in place
Port 465: implicit TLS submission
Port 465 is used for SMTP submission with implicit TLS. The TLS session starts immediately when the connection opens.
Use 465 when your provider documents SMTPS, implicit TLS, or SSL on connect. Do not configure port 465 like a STARTTLS upgrade port.
Port 587: the default for app sending
Port 587 is the normal starting point for authenticated message submission. The client connects, the server advertises capabilities, the client upgrades the connection with STARTTLS, and authentication happens over the encrypted connection.
Use 587 for most:
- transactional email from applications
- password reset and OTP messages
- lifecycle and notification messages
- CI or staging send tests
- provider migrations and credential rotations
Before release, validate host, port, STARTTLS, and SMTP AUTH with the MailSlurp SMTP tester.
Port 2525: provider-supported fallback
Port 2525 is a common alternate submission port used by some providers when standard submission ports are blocked. It is useful only when your provider supports it and documents the expected TLS behavior.
Treat 2525 as a fallback, not as the default SMTP port.
STARTTLS vs implicit TLS
The most common SMTP port mistake is mixing up TLS mode:
587usually means connect first, then use STARTTLS.465usually means TLS starts immediately.25is relay traffic and TLS behavior depends on server policy.2525depends on provider documentation.
If your app says secure: true, that often maps to implicit TLS on 465. If your app says secure: false with STARTTLS enabled, that often maps to 587. Always follow your provider's exact setting names.
How to prove the SMTP port works
An SMTP connection can succeed while the customer still never sees the email. A release-ready SMTP setup should prove each layer:
- The host and port accept a connection.
- STARTTLS or implicit TLS behaves as expected.
- SMTP AUTH succeeds with the intended credentials.
- The message is accepted by the provider.
- The message arrives in a controlled inbox.
- Headers, links, OTP codes, reset URLs, attachments, and rendering are correct.
- SPF, DKIM, DMARC, and deliverability checks match the sender's production posture.
MailSlurp gives teams a practical workflow for that proof:
- SMTP tester for host, port, TLS, authentication, and transcript diagnostics
- Email Sandbox for private received-message testing
- Email integration testing for CI assertions
- Email header analyzer for received-header inspection
- Email deliverability testing for sender and inbox-placement checks
POP And IMAP
POP and IMAP are not SMTP submission ports. POP3 and IMAP help email clients retrieve or synchronize messages from a mailbox. SMTP handles sending and relay.
Common mailbox retrieval ports include:
- POP3:
110 - POP3 over TLS:
995 - IMAP:
143 - IMAP over TLS:
993
For a broader protocol overview, use the SMTP, IMAP, and POP3 ports guide.
FAQ
Which SMTP port is best?
Port 587 with STARTTLS is the best first choice for most authenticated application sending.
Is port 465 still used?
Yes. Port 465 is used for implicit TLS submission when the provider documents that setup.
Should I use port 25 for my app?
Usually no. Port 25 is mainly for server-to-server relay and is often restricted for application egress.
When should I use port 2525?
Use port 2525 only when your provider supports it and standard submission ports are blocked or unsuitable.
Does the SMTP port guarantee delivery?
No. The port only proves where the SMTP connection starts. You still need TLS, authentication, message inspection, sender authentication, and inbox validation.