Picking the right port for an email transmission can make the difference between your email being delivered or not. Luckily, it’s not something you need to think about a lot, as your email service provider does it for you. And they care about successful email delivery as much as you do.
Sometimes, however, the default SMTP port might not guarantee the best delivery. This is when knowing what the alternatives are might really help. Let’s start then!
SMTP and SMTP ports – what are they all about?
Let’s start with some definitions to clarify what we’re talking about.
SMTP (Simple Mail Transfer Protocol) is a technology that sends most emails on the internet. It’s what moves the message from your email client through email servers to the recipient’s server. From there, it’s usually delivered to their mail client over a different protocol – usually IMAP or POP3.
Ports (not in a maritime sense) are communication endpoints commonly used to identify the exact location of an internet address. They’re a part of every domain name address, even though they’re not visible to end-users. For example, to open an HTTP address, you use port 80, and to get to an HTTPS address, you need to use port 443.
When sending emails, SMTP first needs to direct them to a specific address on the internet for further processing. Each email is sent to a dedicated server and a predefined SMTP port.
Modern SMTP transmission can be broken down into two stages – email submission and relaying. Submission is, well, about submitting an email message to an outgoing server. SMTP Relay refers to the process of relaying a message between email servers (known as MTA) on the way to the recipient’s server. Frequently, different ports are used for each of these stages. We’ve covered SMTP Relay in detail in another article.
What are the standard SMTP ports?
There are four of them that are or were considered standard at some point. These port numbers are 25, 465, 587, and 2525. Other ports can also be used for SMTP transmission, but they’re not usually the first choice for Internet Service Providers (ISPs).
Among these four, 587 and 2525 are the more reliable options these days. To understand why, we need to look a bit back into history.
SMTP Ports – different ports for different purposes
Port 25 is the oldest of all SMTP protocols. As a matter of fact, it has been around since the very first days of email transmission. When RFC 821 was launched back in 1982, it established Port 25 as the default transmission channel for internet email. It remained omnipresent for all these years and even now is used for many transmissions.
Over time, SMTP port 25 became a port for sending not only legitimate messages but also unwanted emails. Spammers were roaming freely, sending huge waves of spam full of malware over this somewhat ancient port. As a result, this led to more hosting providers and ISPs blocking port 25 for mail submission.
These days, port 25 is mainly used for SMTP Relaying – transmitting messages between different email servers. It’s not recommended to use for email submission unless you specifically manage your own mail server.
When sending emails this way, you may often hit an error that indicates that port 25 is closed for email submission. Luckily, there are several alternatives, more modern ports you can use freely instead.
It’s important to note that SMTP and its port 25 weren’t secure initially. In 1995, SSL (Secure Sockets Layer) was introduced, establishing the first publicly available way to encrypt emails.
At that time, adding extra security to a port didn’t just mean some extra development. It required establishing an entirely new port for secured transmissions and another for plain text messages (port 25). It wasn’t just an SMTP thing – to this day, protocols such as FTP, IMAP and POP also use two ports for encrypted and plain text messages.
Port 465 was picked as the new, secure SMTP port for email submission to work with port 25 for relaying. Many platforms quickly migrated there. Not long after, though, IANA (Internet Assigned Numbers Authority), in cooperation with IETF (Internet Engineering Task Force), decided to reassign this port for different uses and recommended other ports for secure transmission.
Due to this unusual move, many services that had just switched to 465 were left with a deprecated port. Others quickly flocked to other ports. Even though port 465 was made redundant in 1998, you will still find many services using this legacy software. Some articles might even suggest it as a recommended port. Don’t listen to them.
SSL has also been made redundant since then due to the rise of TLS (Transport Layer Security), a more sophisticated approach to security. Many platforms still rely on SSL and are forced to use an SMTP port for SSL, such as 465. Their lack of support for STARTTLS makes it impossible to use other, often better, ports.
Read more about SSL, TLS, STARTTLS, and others in our other article about SMTP Security.
Unless you really have to, using port 465 for email transmission is not recommended.
We’ve already covered two ports, and we recommended against using either of them. Let’s move on to a bit more positive side 😉
As we mentioned, in 1998, port 465 was made redundant for email transmission. With RFC 2476, internet authorities established port 587 as the standard. At the same time, traditional processing was split into two parts – submission and relaying. Relaying was entrusted to the good ol’ port 25, while all submissions were, from now on, to be directed via port 587.
To this day, SMTP port 587 is the default SMTP port and should be used whenever available. As a matter of fact, it’s supported by nearly all ISPs. It’s also a recommended STARTTLS port, giving your emails an extra layer of security compared to 456.
To test if port 587 works on your server, run the following command in the terminal:
telnet example.com 587
The result of
250 STARTTLS will confirm that it’s ready.
Occasionally, port 587 might not be supported by an ISP or a hosting provider. Other times, running telnet example.com 587 may simply yield errors.
This is when port 2525 may be helpful. It’s an alternative port to 587 that can also be used as an SMTP port that supports TLS. It has the same capabilities as its older brother port but has never been officially recognized by the internet authorities. Its lack of recognition doesn’t prevent it from working as a reliable alternative to 587. In fact, most ISPs also support it.
So which one should I use?
Whenever you’re given a choice, you should use 587 as the default SMTP port. It comes with TLS encryption and is the officially recognized port for email submission.
When 587 is unavailable or doesn’t work as expected, use port 2525 as an alternative. It has the same suite of features as 587 but has not been officially recognized.
For email relaying and relaying only, use port 25. Nothing has changed for the port since 1982, and it’s perfectly sufficient for these purposes.
Don’t use port 465 unless you really need to.
SMTP Port 1025 is also sometimes recommended as an alternative for message submission. Select from ports 587 and 225 if possible, and if neither works, use 1025 as the very last alternative.
Of course, selecting the correct SMTP port is one of many things that guarantee good deliverability. The number of spam complaints received, email content, email infrastructure, etc., play an essential role in your deliverability. The trick is understanding what causes poor deliverability and adjusting.
This is precisely where a tool like Mailtrap Email Sending can be helpful, it provides a stable email infrastructure for email sending and performance monitoring with high deliverability rates by design.
Email Sending has two sending solutions: SMTP for quick and easy integration with any application to start sending in seconds, and Email API for greater flexibility. This way, you’ll be able to control your email performance with helicopter-view dashboards, drill-down reports with detailed stats on mailbox providers and email categories, and extended email history with up to 60 days of email logs.
If any email deliverability metrics suddenly drop, Mailtrap critical alerts will notify you immediately so you can fix the issue without delays.
Which ports are commonly used?
Let’s now check the default SMTP server and ports for Gmail and other SMTP clients. In some cases, you might be able to change the ports to your desired ones. When working with reputable providers, the ports displayed below are already well-tested and, as such, reliable.
When in doubt, contact your provider to learn what ports you can use when sending emails via their SMTP.
|Service name||SMTP server||Port|
|Gmail||smtp.gmail.com||465 for SSL and 587 for TLS|
|Yahoo||smtp.mail.yahoo.com||465 for SSL and 587 for TLS|
|Mailtrap Email Sending||live.smtp.mailtrap.io||587 (recommended), 25, or 2525|
This sums up our guide to the common SMTP ports. You should now have a fairly solid foundation of information about which ports can be used for what. If you’re planning on setting up your own SMTP server using this information, you might find some of these materials helpful:
- Set Up SMTP Server – A Step-By-Step Tutorial
- All You Need to Know about SMTP Server
- List of All SMTP Commands and Response Codes
- Free SMTP Servers List: 10 options to Send High Volume Emails
- Difference Between IMAP, POP3, and SMTP Email Protocols
- What SMTP Authentication Is and Why You Can’t Ignore It
- SMTP Server for Testing: Cloud-based or Local?
- How to Send Email Using API or SMTP
- How to Configure WordPress SMTP Settings