Understanding SMTP ports 25, 465, 587, 2525 and choosing the right one
SMTP (Simple Mail Transfer Protocol) is a quick and easy way to get started with sending emails. As an industry-standard protocol, you simply provide your server name, port, username and password. Then, the SMTP server takes care of sending emails on your behalf—sounds good!
But when it comes to filling in that SMTP port field, what should you add and why? Is there a difference between ports 25, 465, 587 and 2525?
In this guide, we’re breaking things down and taking away all the mystery from SMTP ports. Stick around to learn what SMTP ports are, the common SMTP ports in use (or not in use anymore!), which port you should use with MailerSend and why, and how to get started with SMTP.
What are SMTP ports?
In computer networking, a port is a logical address that identifies a specific network service. When a computer program wants to communicate with a network service, it sends a message to the appropriate port on the destination computer.
The default port for SMTP servers is port 25, but many servers use other ports as well, such as 587, 465 or 2525. In the context of SMTP, ports are used to identify the service at the mailer server that is responsible for handling email messages.
When an SMTP server receives a message, it looks at the port number in order to determine how to handle the message. For example, if a message is sent to port 25, the server will know to process it as an incoming email message.
SMTP uses the TCP/IP protocol, which is the standard protocol for transmitting data over the internet. TCP/IP allows SMTP to communicate with other email systems and transfer email messages between them.
Most common SMTP ports
Now we’ve been through what SMTP ports are, let’s go through the 4 most common ports and their use cases.
Port 25
The OG of SMTP ports, port 25 appeared in the original SMTP proposal of 1982, making it the oldest port on the list. It’s commonly used for sending email via SMTP but is also sometimes used for other purposes, such as the remote management of network services.
Port 25 is the default SMTP port that is used to enable communication between the sending and receiving servers when delivering an email message to a recipient. Despite its pedigree, many ISPs (Internet Service Providers) and email providers have started to block incoming connections on port 25 as a security measure. This is due to the prevalence of spam and other types of email-based attacks. So, if you want to ensure your emails aren’t being blocked, you should use a different port to send with.
Port 465
Port 465 was an email submission port used for SMTPS (Simple Mail Transfer Protocol Secure). It offered secure client-server communication by encrypting the contents of emails. You may have noticed we’re using the past tense here. That’s because SMTPS was deprecated after STARTTLS (a command to change a connection to a secure one) was introduced.
Some email servers may still be using port 465 to support older mail clients that implemented SMTPS before. So, unless you need to maintain legacy email applications across a large enterprise, for example, you should not be using port 465 to send emails with SMTP.
Port 587
SMTP port 587 is known as the “submission” port, and is specifically intended for use by email clients that need to send messages to an SMTP server. Port 587 is the most secure SMTP port and the preferred port of ISPs and ESPs (Email Service Providers), as it works hand in hand with email authentication to ensure that only authorized senders can send emails through the server. This makes using port 587 a secure way to send emails and prevent spamming and other types of email attacks.
Another key difference between port 587 and port 25 is that the latter is open to the public while port 587 is used for SMTP client connections and is not intended for public use. It also supports Transport Layer Security (TLS)—the successor to Secure Sockets Layer (SSL)—a security protocol that encrypts emails while they are in transit.
All of this considered, it is recommended that you always use port 587 to send emails with SMTP.
Port 2525
Port 2525 plays on the original SMTP port 25 by repeating it twice! If for some reason you are blocked from using port 587, port 2525 is a good alternative port. Although it can be a useful alternative when you’re in a pinch, not all email servers will support connections to this port, so it may not always be possible to use it to send emails.
It’s also worth noting that while many ISPs and mail servers allow access to port 2525, it is actually not an official SMTP port, as it is not recognized by IETF or IANA.
Which SMTP port should you use?
While the port you should be using generally depends on your specific use case and circumstances, it is highly recommended that you use port 587. It’s a preferred port by ISPs and ESPs because:
It’s used in conjunction with email authentication protocols that help prevent unauthorized use and malicious attacks via the sending account.
It supports TLS encryption which encrypts email messages while they are in transit, protecting email content from being intercepted.
Port 587 typically requires that the email client being used is configured with a username and password, so the server can authenticate the client before allowing it to send an email. This helps to ensure that only authorized users can send emails through the server, reducing the risk of spam and other email-based attacks.
The usage of port 587 is in compliance with Internet Engineering Task Force (IETF) standards and is recommended as the default mail submission port.
It’s widely supported by email servers and client software and is less likely to be blocked by ISPs and firewalls, making it more reliable.
What happens if you use the wrong port number?
Oops! If you do use the wrong SMTP port number when trying to send an email, it can be easily fixed. Just know that any emails sent with the incorrect port will go undelivered. It’s important to keep in mind that different ESPs will have different policies regarding the ports they use. Always check their documentation for the recommended SMTP port!
SMTP ports that MailerSend uses
We couldn’t preach the use of port 587 without using it ourselves! In order to provide the most secure and efficient transactional sending experience, MailerSend only uses SMTP port 587. That means when you're using your MailerSend SMTP credentials, if the plugin or app requires you to enter an SMTP port, you should always enter 587.
Setting up SMTP with MailerSend
It’s easy to get started with SMTP in MailerSend. Best practices for SMTP ports are used in the default settings and MailerSend takes care of your email deliverability. Here’s how to get started.
1. Start at the Dashboard
Log in or sign up for a MailerSend account if you don’t already have one and head to the dashboard.
2. Visit your sending domains
Under Email, navigate to Domains. If you’re a new user, you will need to verify a sending domain. Once done, click Manage next to the domain in the list.
3. Enable SMTP mail
On the Domain settings page, scroll down until you see the SMTP section. The REST API is the default mode of sending transactional emails in MailerSend. Enable SMTP sending by clicking on the toggle button.
4. Copy your SMTP settings
Your SMTP settings will be automatically generated, including the server name, port, username and password. Click on each field to automatically copy it to the clipboard!
For the password field, you will need to toggle the visibility of the password by clicking on the eye icon. Once done, you can hover over the password field and copy it to the clipboard.
5. Use the SMTP settings
Now it’s time to configure the SMTP settings into your app or email client. Here, we’ll use the MailerSend WordPress SMTP integration.
Install the plugin by searching for MailerSend – Official SMTP Integration. Activate it and then go to MailerSend SMTP in the WordPress sidebar navigation. Enter your SMTP credentials from MailerSend under SMTP username and password and then click Save.
The port is set to 587 by default, so you won’t have to enter it here. You can proceed to enter customized sender details and send a test email. And that’s it!
Choose your SMTP ports wisely
When it comes to ports and choosing the right one for your emails, the sheer number of options can be rather overwhelming. But, if you want to follow best practices, ensure ultimate email security, and more reliable email delivery, port 587 is your best friend (with port 2525 on standby in case you really need it). Just remember, we’re making things easy for you here at MailerSend—you’ll only ever need to use port 587.
Which is your preferred SMTP port and why? Share in the comments below!
Ready to advance your email?
Sign up to MailerSend's SMTP service and get 3,000 emails per month free.