Which SMTP Port Should I Use?
Picking the right port for SMTP mailservers
There are multiple SMTP (Simple Mail Transfer Protocol) ports that are used for different purposes. You need to know the primary role of each port as well as the port being used by your email service provider to receive the incoming emails otherwise your emails will not reach their destinations. In this article, you will learn everything about the SMTP ports and which one should you choose. So, let's begin:
What is an SMTP port?
An SMTP port refers to a communication endpoint that manages the email exchange process over SMTP and directs the email from one SMTP server to another located nearest to the destination. It is, basically, a process of routing emails from one SMTP server to another via the Internet.
Which SMTP port should you choose?
You will understand which port is most suitable for you as we move forward with the types of SMTP ports:
- Port 25
SMTP port 25 is the first port established by Internet Engineering Task Force (IETF) in 1982, as a default Internet-based email transfer channel. Still, this port is being used today but for SMTP relaying only, which is the process of transferring emails from server to server. Several ISPs and email clients do not use port 25 anymore due to its weak security.
- Port 465
SMTP port 465 was assigned as an encryption protocol to ensure secure email transfer over the wireless channel, by IANA in the 1990s. But later, it was replaced by port 587. Today, it comes into play if demanded by any application.
- Port 2525
Port 2525 is used as an alternative port for running SMTP services incase port 587 is blocked. It is also a secure port as it supports TLS encryption.
- Port 587
Port 587 is used to perform the mail submission duties and provides the best options when an email is submitted for routing by a proper mail server. It is a very popular port due to its high encryption, compatibility, and optimal configuration services.
What's the role of POP and IMAP?
POP (Post Office Protocol) and IMAP (Internet Message Access Protocol) are two of the most popular protocols used to retrieve email from a mail server. POP uses TCP ports 110 and 995, and IMAP uses TCP ports 143 and 993, for secure and insecure service delivery. Some of their most popular services include reflecting the email state back to the server and email copy preservation on a local machine for easy offline access.
SMTP with MailSlurp
Communication between any computer and MailSlurp's SMTP endpoint is a bit longer as compared to MailSlurp's API endpoint, as shown below:
\> openssl s_client -starttls smtp -crlf -connect smtp.mailslurp.org:587 250 STARTTLS \> ehlo blog.mailslurp.com 250-ak47 250-AUTH PLAIN LOGIN 250-SIZE 52428800 250-8BITMIME 250-ENHANCEDSTATUSCODES \> AUTH PLAIN AHBvc3RtYXN0ZXJAc2FtcGxlcy5tYWlsZ3VuLm9yZwAza2g5dW11am9yYTU= 235 2.0.0 OK \> MAIL FROM:\<email@example.com\> 250 Sender address accepted \> RCPT TO:\<firstname.lastname@example.org\> 250 Recipient address accepted \> DATA 354 Continue \> This is a test of SMTP over port 587. \> . 250 Great success \> QUIT 221 Cya
If you want less chatting between the sender and the receiver and execute the commands quickly then MailSlurp's API endpoint is a better option. Establishing a connection with it is also very simple. But, if you don't want a connection set up via API, then SMTP endpoints are always there for you.