Skip to main content

What SMTP Port Should I Use?

Learn about SMTP ports 25, 465, 587, and 2525. Understand their differences and find the best SMTP port for secure and efficient email delivery.

What SMTP Port Should I Use?

Key Takeaways

  • SMTP (Simple Mail Transfer Protocol) enables email transmission between servers and clients.
  • Four ports are commonly mentioned for SMTP: 25, 465, 587, and 2525, but only 587 and 2525 are recommended today.
  • Port 25 is reserved for server-to-server relay and often blocked by ISPs due to spam abuse.
  • Port 465 is deprecated and should not be used.
  • Port 587 is the modern, secure standard for authenticated submission with TLS.
  • Port 2525 serves as a practical alternate when 587 is blocked.
  • Proper port configuration improves deliverability and ensures encrypted, compliant email transmission.

Q&A Highlights

  • What’s the purpose of SMTP and why does the port matter?SMTP defines how email moves from sender to recipient across the internet. The port determines how and where these messages are transmitted—choosing the wrong one can block delivery or weaken security.
  • Why is port 25 no longer recommended?Port 25 was once standard but became the primary target for spam and malware. Most ISPs now block it to prevent abuse, reserving it mainly for inter-server communication.
  • What about port 465?Port 465 was originally assigned for SMTPS (SMTP over SSL) but was deprecated. It’s now reserved for other purposes and shouldn’t be used for modern email submission.
  • Which SMTP port should I use today?Use port 587 with STARTTLS for secure, authenticated email submission. If that’s unavailable, port 2525 is a supported fallback by many providers including SparkPost.
  • What’s the practical difference between submission and relaying?Submission (usually port 587) is when a client hands off mail to a server for sending. Relaying (usually port 25) happens between mail servers transferring messages across domains.

People configuring an app or mail system to send (or relay) email often have a common question: "What SMTP port should I use?"

Why is port 25 usually blocked? How can you check if it is?

Port 25 is blocked on many networks to curb the amount of spam that is relayed from compromised computers or servers. Unless you’re specifically managing a mail server, you should have no traffic traversing this port on your computer or server.

To check if port 25 is blocked by an ISP:

  • If you are using Windows, open up your command prompt. If you are using a Mac, open up your Terminal. And, if you are using Linux, open up your Terminal emulator.
  • Type the following command: telnet examplemailserver.com 25

If port 25 is not blocked, you should receive a message like this one:

user@localhost:~# telnet gmail-smtp-in.l.google.com 25 Trying 1.2.3.4... Connected to gmail-smtp-in.l.google.com. Escape character is '^]'. 220 mx.google.com ESMTP 123si3448417qkd.359 - gsmtp

If port 25 is blocked, you'll receive a message like this:

Connection refused telnet: Unable to connect to remote host

Which SMTP Port Should I Use: Port 25, 465, 587 or 2525?

People configuring an app or mail system to send (or relay) email often have a common question: "What SMTP port should I use?" You might see information that tells you to use ports 25, 465, 587, or 2525 for SMTP relay. So, which of these should be your standard SMTP port? Here’s what you need to know, and why.

What is an SMTP port?

SMTP (Simple Mail Transfer Protocol) is the basic standard that mail servers use to send email to one another across the internet. SMTP is also used by applications such as Apple Mail or Outlook to upload emails to mail servers that then relay them to other mail servers. (On the other hand, mail apps typically rely on other standards such as IMAP or POP3 to retrieve emails from servers.)

Like other Internet services such as web sites, SMTP email relies on domain names and Internet addresses to know where to send messages. All of us today are familiar with the textual version of these addresses, like www.sparkpost.com. Most of us know that the text address stands in for a numeric IP address like 107.21.246.67. But not as many of us know that these network addresses also include specific "port numbers." An "SMTP port" refers to the specific part of the Internet address that’s used to transfer email.

The web and HTTP use port number 80. For email and SMTP, that port number is… well, it depends.

Diagram illustrating the process of email transmission and reception, featuring email client icons, servers, and arrows showing the flow from email submission through ports..

How Is SMTP Different From SSL and TLS?

Both technologies facilitate email sending. While SMTP could be the muscle and bones of the process, Secure Sockets Layer (SSL) forms the skin to keep your email secure. SSL works with any available port.

SSL was the go-to standard security protocol for common email ports in the not-too-distant past. With the adoption of its new-and-improved descendent, Transport Layer Security (TLS), electronic communications became even more secure.

While both protocols create a private channel between the sending and receiving computer to secure transmissions, TLS offers more alerts than its ancestor and can execute more hash functions to enhance encrypted communication. Today, many emails use the most up-to-date convention, STARTTLS, which combines with either SSL or TLS protocols for maximum security.

The SMTP protocol on its own is not as secure as it could be. Using the transfer method in conjunction with one of the security protocols provides more encryption protection. For sending email, SSL and other protocols enhance the SMTP transmission.

How can you find out what your SMTP port is?

If you are subscribed to a hosted email relay service you can get the SMTP server hostname and port number from the support page of your email service.

If you run your own SMTP server you can find the configured SMTP port number and address from the SMTP server configuration. In PowerMTA you can find that information from the configured "smtp-listener" directive within the config file. The config file can be found in /etc/pmta/config on a Linux server and C:\pmta\config.dat on Windows Server.

listens on port 587 and IP 10.0.1.22

smtp-listener 10.0.1.22:587

Which port should you use for SMTP?

Ports 25, 465, 587, or 2525 for SMTP have all been considered standard SMTP ports at some point, but only 587 or 2525 really should be considered for modern use.

If you’re configuring your systems to use SparkPost as an SMTP relay service, you should use port 587 as your standard SMTP port, with 2525 as an alternate in case port 587 is not available.

I’ll explain why as we run through the different ports commonly used for sending email today.

Below is a quick comparison to help you choose the right SMTP port.

Port Number

Description

When to Use It

25

Standard SMTP port

Often blocked by ISPs and cloud providers

465

Out-of-date (deprecated) port for secure SMTP

Do not use unless absolutely necessary

587

Modern port for secure SMTP

The best choice for SparkPost and modern apps

2525

Alternative, non-standard SMTP port

An alternative in cases when standard ports are not available

Port 25: The original standard SMTP port

Port 25 is the original standard email SMTP port and the oldest, since it first debuted in 1982. Today, the Internet Assigned Numbers Authority (IANA), the group responsible for maintaining the internet addressing scheme, still recognizes port 25 as the standard, default SMTP port. SMTP was designated to use port 25 in IETF Request For Comments (RFC) 821. But in practicality, it’s not as simple as it seems.

Although port 25 continues to be used for server-to-server SMTP relaying, most modern SMTP clients should not be configured to use this port. Port 25 is usually blocked by residential ISPs and business cloud hosting providers alike because it earned a bad reputation as the preferred port for spammers sending massive quantities of unsolicited communications.

Port 465: Deprecated and out-of-date SMTP port

Port 465 is no longer an accepted standard for SMTP. However, there are some legacy systems that still use port 465 for SMTP, and some help pages on the internet still suggest port 465 as the recommended setup. The port gained redundancy in the late 1990s but still relies on the passive implicit SSL method for establishing secure transmission. Our advice? Don’t do it unless your application absolutely requires it.

IANA initially assigned port 465 for an encrypted version of SMTP called SMTPS. Initially, it was proposed to send emails using the Secure Sockets Layer (SSL). However, IANA has since reassigned this port for a different use, so it should no longer be used for SMTP. This is why SparkPost does not accept connections on port 465.

Port 587: The standard secure SMTP port

Modern email servers use port 587 for the secure SMTP submission of email for delivery. For example, if you use an email client software like Outlook or Apple Mail, it most likely is configured to use this port to send your messages. It’s not just personal email client software, however. Systems that transmit messages to an email delivery service like SparkPost also should be configured to use this port.

All SparkPost customers should use port 587 as default, unless you’re explicitly blocked by your upstream network or hosting provider. Using port 587, coupled with TLS encryption, is the best way to ensure that email is submitted securely and reliably to SparkPost (or nearly any other provider).

Port 2525: A common alternate SMTP port

Port 2525 is not an official SMTP port, and it is not sanctioned by the IETF nor IANA. However, SparkPost and many other email service providers support the use of port 2525 as an alternative to port 587 for SMTP, in the event the above ports are blocked. (One notable example where this is required is for services hosted on Google Compute Engine.) If you’ve tried port 587 but experience connectivity issues, try port 2525. Just like port 587, most implementations that listen on port 2525 also support TLS encryption.