SMTP Ports: How to Choose the Right One
Estimated reading time: 8 minutes
The process of transmitting email messages from the sender to the recipient is carried out by Simple Mail Transfer Protocol (SMTP). Email service providers have their SMTP servers, which deliver emails to the recipients’ servers. The sender just creates an email, fills in their name and email address, and hits “Send”. The email distribution is then managed by the SMTP server maintained by the ESP.
However, in some circumstances you need to provide the SMTP server details in third party tools. For example, in GlockApps, you have to create a sending account with the SMTP settings to be able to use automatic email deliverability tests. In this scenario, the SMTP server name, SMTP port number, username, and password are the required details. Sounds simple, doesn’t it?
Still, there is a misunderstanding about what SMTP port to pick and why, and what actual differences between ports 25, 465, 587, and 2525 are.
In this article, we’ll cover the basics on the most popular SMTP ports in order you can choose the right port number when filling out the details of the SMTP server.
What is SMTP Port?
In a computer environment, a port is a logical address to identify a particular network service. A program sends a message to the specified port on the target computer when it wants to interact with a service running on a different computer.
An SMTP port is a communication endpoint that handles the transmission of emails from one server to another. SMTP ports assist in directing email traffic to the relevant mail server service that handles message delivery and processing.
SMTP ports are defined by the Internet Assigned Numbers Authority (IANA) in consultation with the Internet Engineering Task Force (IETF). SMTP works based on the TCP/IP protocol, which is the standard protocol used for transmitting data over the internet. TCP/IP allows SMTP to connect with other email systems and transmit electronic messages between them.
What are the Most Common SMTP Port Numbers?
The default SMTP port number is 25. Also, SMTP often uses port numbers 465, 587, and 2525. Let’s go over different situations and examine when each of the ports is used.
SMTP Port 25
The port 25 is the default SMTP port, which has been used for decades for delivering email messages between sending and receiving servers.
When sending emails, email clients connect to the outgoing mail server (SMTP server) on port 25 transmitting important information such as the email’s content and the recipient’s address. From there, the message is managed by the SMTP server, which uses a variety of network protocols and technologies to route it to the recipient’s mail server.
However, due to the increase in spam and email-based assaults, a lot of ISPs and email service providers have started to block inbound connections on port 25. For safety measures, email service providers now send email messages using alternate SMTP ports, which supply a more secure data transmission method.
SMTP Port 465
Email clients that want to transmit emails securely utilize the SMTP port 465 as an alternate port number. The data security is stipulated by the incorporation of the SSL (Secure Sockets Layer) encryption on port 465.
When an email client connects to the SMTP server via port 465, email content, attachments, and authentication information are all secured during transmission thanks to the SSL-encrypted connection that is established between the client and the server. By using encryption, you can be guaranteed that the conversation will stay confidential and safe from prying eyes.
It is to note that the implementation of the TLS security protocol made port 465 obsolete. However, many older email systems and SMTP clients still rely on SSL and continue to utilize port 465 as their default SMTP port number.
SMTP Port 587
Following the approval of RFC 2476, port 587 has been the standard port for SMTP message submission since 1998. Modern email clients connect to the outgoing mail server via port 587. While port 25 is frequently restricted by ISPs in an effort to decrease spam, the SMTP port 587 is normally open and available for encrypted email delivery.
The SMTP port 587 is a recommended option for email transmission due to its benefits:
- Enhanced security: TLS (Transport Layer Security) and STARTTLS (StartTLS) are two popular encryption methods that use port 587. Email content is safeguarded while transit between systems via a TLS-encrypted connection, guaranteeing secure and impenetrable conversations.
- Authentication: before sending emails over port 587, users usually need to authenticate with a username and password. This guarantees that only authorized users may submit emails for delivery and helps prevent unwanted access.
- Privacy: while port 25 is typically open to the public and may be used for other operations in addition to email delivery, the SMTP port 587 is intended for the email transmission only and is not available publicly.
- Delivery optimization: before accepting an email, mail servers can carry out further checks using port 587, such as sender reputation analysis and spam filtering. This enhances the messages’ overall deliverability.
SMTP Port 2525
The port 2525 can be used when other SMTP ports are not available or supported. However, sending emails using this port might not always be an option because not all email servers allow connections on it and neither the IETF (Internet Engineering Task Force) nor IANA have formally acknowledged it as an SMTP port.
What SMTP Port to Choose?
When you are setting up your email application to send out emails, you’ll want to use the SMTP port 587 – this is the default and secure SMTP port for email transmission and it ensures secure data transfer via TLS.
If port 587 is blocked for some reason, you can try using port 465. Many providers still support this port for SMTP.
In the scenario when both ports 465 and 587 are not available for SMTP connections, port 2525 is a common alternative. Although this port is not an officially recognized SMTP port, most providers allow it for SMTP connections behind the scenes.
Finally, you should avoid using port 25 by any means because most ISPs and hosting providers block inbound connections on port 25.
What Happens if the Wrong SMTP Port is Used?
If you enter the wrong SMTP port number when configuring your email client, the email client is not able to connect to the specified mail server on the defined port. The mail server returns an error message.
Below are the most common errors related to the wrong combination of the host and SMTP port number:
Failed to connect to SMTP server
Connection rejected
Connection timed out
Nothing is listening at the remote host:port
Cause: the SMTP port is blocked by firewall or is not supported by the mail server for email delivery.
How to fix: ensure nothing is blocking the port number; enter a different port number, which is not blocked.
SMTP authentication failed
Username and/or password is not accepted
Cause: wrong username and/password for authentication with the mail server or the mail server doesn’t require authentication.
How to fix: make sure the defined SMTP port requires authentication; if it does, double check the entered credentials for accuracy; reset the password if necessary.
SSL/TLS handshake failed
Unable to establish a secure connection
Cause: wrong combination of the SMTP port and security protocol or issues with the SSL/TLS certificate.
How to fix: make sure the SSL/TLS certificate is valid; double check the accuracy of the selected port number and security certificate.
Relay access denied
Unable to relay
Cause: the domain or IP address you are trying to send emails from is not allowed as a sending domain with the SMTP server.
How to fix: ensure you entered the correct SMTP server name, port number and security protocol; configure the SMTP relay settings on the SMTP server to allow your domain or IP address to send email messages.
It is important to remember that you can always contact your email service provider, ISP or hosting provider to find out what SMTP server name, SMTP port number, and SSL/TLS protocol you have to enter when setting up your email client to send email messages via their mail server.
How to Use SMTP Port in GlockApps
The GlockApps email testing service allows to automate email deliverability testing by means of sending accounts.
You enter your From email address and From name that should be used for sending the messages to the seed email list. Additionally, you enter the SMTP server name, SMTP port number, and security protocol. If the SMTP server requires user authentication, provide your username and password.
As mentioned above, you can get the accurate SMTP information including the port number to use from your email service provider or hosting provider.
It is important to note that GlockApps supports two security protocols: none and SSL. The “none” protocol works as STARTTLS. Thus, if you enter port 587 that requires STARTTLS, select the “none” security protocol in the sending account settings.
A sending account with the working SMTP settings allows to quickly test email messages by sending them to one proxy email address and run Inbox Insight tests on auto-pilot with automatic tests.
Conclusion
Choosing the right SMTP port is essential in today’s environment when email plays a major role in both personal and professional communication. The right SMTP port guarantees that emails are transmitted safely and consistently, protecting data security, privacy, and the efficiency of email correspondence.
To ensure secure communication, port 587 is the best choice. It is normally open for email submission on the majority of mail servers. Alternate port numbers could be 465 and 2525. It is highly recommended to avoid using port 25 due to a variety of limitations and security risks associated with its use.
If you’re not sure which SMTP port to use, refer to the documentation of your email service provider, ISP or hosting provider, which SMTP server you want to utilize for email sending.