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


\> ehlo blog.mailslurp.com



250-SIZE 52428800




235 2.0.0 OK

\> MAIL FROM:\<test@samples.mailslurp.org\>

250 Sender address accepted

\> RCPT TO:\<recipient@samples.mailslurp.org\>

250 Recipient address accepted


354 Continue

\> This is a test of SMTP over port 587.

\> .

250 Great success


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.

Related content

Java email library for SMTP and creating email addresses

MailSlurp Java SDK for sending and receive email and attachments on the JVM.

SMTP email application libraries

How to send email in CSharp, PHP, Ruby, Java, Python, and NodeJS using the SMTP protocol and MailSlurp mailservers.

How to Send an Email in Python

Send emails using SMTP mailer in Python. Detailed tutorial for sending mail in Python.

How to send emails in Javascript (NodeJS)

JS SMTP email sending guide using HTML and NodeJS.

How to send an email using Powershell (Windows and cross-platform)

Use Send-MailMessage in Windows Powershell to send emails using an SMTP server or MailSlurp's free email API.

Test SMTP servers with Telnet

How to use Telnet to test the SMTP servers?

What Is Amazon Simple Storage Service (SES) - And How Can I Use It?

Amazon SES is an email service among virtual servers, AI apps, and libraries. Ideally, you can integrate your email system with your program hosted on Amazon.

Grab all details about an SMTP Port

What are common SMTP mail server ports and how do you find them?

Which SMTP Port Should I Use?

Picking the right port for SMTP mailservers

Avoiding email spam filters

How to send emails that don't trigger a spam warning.

BCC and CC in SMTP emails

BCC and CC in SMTP emails

BCC For Email: What It Means And When To Use It

What is BCC email field (blind carbon copy) and how does it differ to CC?

What Is The Best SMTP Port To Use?

MailServers use TCP ports to transmit emails. Picking the right port between 25 vs 2555, 465 vs 587 in SMTP is easy with this guide.

How to configure Mail desktop clients with MailSlurp

How to setup MailSlurp with Outlook, Gmail, Thunderbird, Mail app and more.

Send email with CSharp using SMTP Client and MailSlurp

Create a custom SMTP client and access MailSlurp inboxes from CSharp/DotNET.

DMARC – All Facts that you should know

DMARC – All Facts that you should know

Email size limits

Email size limits

The Fundamentals Of Email Subdomains

How to manage email subdomain custom mailboxes using SMTP/IMAP mailserver settings.

A guide to PHP Mailer

A guide to PHP Mailer

SMTP IMAP Settings

How to access MailSlurp email accounts using IMAP and SMTP servers

SMTP Relay for outbound smtp servers

How to use SMTP relay to address spam and security issues that affect outbound mail servers.

SMTP vs HTTP MailSlurp inboxes

The difference between HTTP and SMTP inboxes and domains in MailSlurp.

What are SMTP ports

What are SMTP ports

CSharp send SMTP email

How to use CSharp SMTP client to send email with MailSlurp mail server

Send SMTP email with Java

How to use Java SMTP client to send email with MailSlurp mail server on the JDK

Send emails in NodeJS using SMTP

How to use Javascript SMTP client (or Nodemailer) to send email with MailSlurp mail server

Send SMTP emails with PHP

Use PHPMailer to send emails with SMTP and MailSlurp

Send SMTP email with Python (using SMTPLib)

How to send emails with Python's built-in SMTP client and MailSlurp mail servers.

Ruby send SMTP email

How to use Ruby SMTP client to send email with the MailSlurp mail servers

Ready to dive in?Start building email applications today.