SMTP ports explained: 25 vs 465 vs 587

By the LeadsPaw team · Last updated

Every email tool's settings page asks the same question: SMTP port 25, 465 or 587? The three ports are not interchangeable options - they are two different jobs, defined across the SMTP standards. RFC 8314 ("Cleartext Considered Obsolete") draws the lines, and its history of port 465 explains why settings pages still offer both 465 and 587.

Port 25: server to server, not you to your provider

Port 25 is the relay port - how one mail server hands a message to the next. RFC 8314 states the reason it can never move: the DNS MX infrastructure that routes mail between servers has no way to specify a port, so port 25 is always used. When your sending tool asks for a port, 25 is almost never the right answer - that port is for the servers, not for your app.

Ports 587 and 465: submission, two flavors of TLS

Submission is the other job: your mail program or app handing outgoing mail to your provider's server. Two ports do it, differing in how encryption starts:

  • 587 - the message submission port from RFC 6409, used with STARTTLS: the connection begins unencrypted and is upgraded to TLS in place.
  • 465 - implicit TLS: the connection is encrypted from the first byte. RFC 8314 registered port 465 for "submissions" (Message Submission over TLS) in 2018.

The backstory, per RFC 8314: port 465 was briefly registered as "smtps" long ago; that registration made no sense for relay (MX always uses 25) and was revoked - but widely deployed mail software had already interpreted it as secure submission and kept using it. Rather than leave real-world practice unregistered, RFC 8314 documented it, noting that STARTTLS on 587, though deployed, has not replaced implicit TLS on 465.

The rule that overrides the numbers: no cleartext

The RFC's title is the policy. Providers still letting users submit mail in cleartext on port 25 should transition them to TLS - implicit TLS or STARTTLS - as soon as practicable, and mail submission servers must support TLS 1.2 or later. So when you configure a tool: pick the submission port your provider documents (465 or 587), make sure encryption is on, and leave 25 to the servers.

Port choice gets your mail to your provider; what happens next depends on your domain's authentication. Pair the right port with SPF, DKIM and DMARC and check the receiver's verdict with the headers guide - and if you are sending cold email at volume, Gmail's sender requirements set the rules of the road.

Frequently asked questions

What is the difference between SMTP ports 25, 465 and 587?

Port 25 is for server-to-server mail relay - per RFC 8314, the MX infrastructure has no way to specify a port, so port 25 is always used between mail servers. Ports 587 and 465 are for message submission - your app or mail program handing outgoing mail to your provider: 587 with STARTTLS (per RFC 6409, noted as deployed in RFC 8314) and 465 with implicit TLS (registered for submissions by RFC 8314).

Should I use port 465 or 587 for sending?

Both are legitimate submission ports with TLS. RFC 8314 registered 465 for message submission over TLS to match widespread existing practice, and notes that although STARTTLS on 587 has been deployed, it has not replaced implicit TLS submission on 465. Use whichever your email provider documents for your account, with TLS on.

Is sending email over port 25 without encryption still acceptable?

RFC 8314's title is its answer: cleartext is considered obsolete. It says providers still supporting cleartext SMTP on port 25 for user message submission should transition their users to TLS - implicit TLS or STARTTLS - as soon as practicable, and that mail submission servers must support TLS 1.2 or later.

Why does my provider list two ports for the same SMTP server?

Because both submission modes are in active use. RFC 8314 explains the history: port 465 was briefly registered as smtps, that registration was revoked, but deployed mail software kept using 465 for secure submission - so the RFC registered 465 for submissions alongside the existing STARTTLS submission on 587, documenting real-world usage rather than fighting it.