Email best practices
Which SMTP port should I use with Mailjet?
In this article you will learn more about what is SMTP, what is an SMTP port, and which port you should use to send emails.
PUBLISHED ON
Choosing an SMTP port can be tricky. If you’re configuring your email system to send or relay email, you’re probably wondering: “Which SMTP port should I use?” Sounds tough...
To be honest, there are a few things to take into consideration. Do you need some kind of encryption? Or would this port be open at the recipient’s end for receiving emails? Does the email service provider you use support this port?
Yes, we know. There are so many things to think about, it’s easy to get lost... Which is why, in this article, we will help you find the answers you need to find the right configuration for you.
Table of content
Port 25: Simple mail transfer protocol port
Port 80: Hypertext transfer protocol port
Port 465: Authenticated SMTP over SSL port
Port 587 and Port 588: Email message submission port
Port 2525: The alternative port
Table of content
What is SMTP?
Simple Mail Transfer Protocol or simply SMTP, is the basic standard that email servers use to send email to one another across the internet. SMTP is also used by some applications and services to relay their users to other email servers.
Using a process called "store and forward," SMTP moves your email across networks. It works closely with something called the Mail Transfer Agent (MTA) to send your communication to the right computer and email inbox. MTA is each software app used by email clients (e.g. Gmail, Outlook, Apple Mail, etc.)
SMTP could also be used as a TCP/IP protocol to receive emails, however, since it is limited in its possibility to queue messages at the receiving end, it is usually used only for sending. POP3 or IMAP protocols are used alongside SMTP for receiving emails that let the user save messages in a server mailbox and download them periodically from the server. Not so complicated now, right?
What is an SMTP port?
Let’s start with what a port is.
If we are talking about a networking port, it’s not like the ports that let you charge your computer or plug in your mouse to your computer.
Ports actually have a very specific and very well defined meaning when it comes to digital communications
To understand how ports work, we need to take a step back and see what happens when computers communicate with each other on the internet.
Let’s say you are trying to reach mailjet.com. In this case, the Domain Name System (DNS) is converting this to the actual IP that is hidden behind the name of the site. In Mailjet’s case, this is 104.199.110.216. You probably could remember 4-5 IPs like ours, but who can actually remember more, or really...who would want to?
So, now your server is requesting to connect you with this site from your ISP. What’s next? Here’s where the port comes in handy.
We know that the address we want to reach and the port number (80 in this case) tells the server what it is you want it to do. You can think of the ports as the number of addresses you would like to reach. The IP address would be equivalent to the physical address of the recipient, and the port number might be the individual within the street that’s supposed to receive your letter.
In other words, a port is an endpoint to a logical connection. At the software level, within an operating system, a port is a logical construct that identifies a specific process or a type of network service.
The port number identifies what type of port it is. Some ports have numbers that are assigned to them by the IANA, and these are called the "well-known ports", which are specified in RFC 1700.
Each port has two stats - open and closed. If the port is open, it means that you can establish a connection and transfer the information. If the port is closed, you won’t be able to reach it and the connection will fail.
You can actually check if a port is open or not by telnetting it. How to do this? That’s too much for this post, but you can learn more about it in this detailed article.
An SMTP port is one that is meant to be used for SMTP connections. Today, the most common SMTP ports are 25, 465, 587, or 2525. This doesn’t mean that they are the only ones, though. These few ports are the most used ones for this type of connection, and because of that they are almost always open, which means you should be able to reach your destination. OK, we know that you are excited to learn more.
An SMTP port is an endpoint used to establish SMTP connections so emails can be sent.
Which SMTP port should you use?
So, what SMTP port should you use to send your emails? Here’s an overview of the different ports you can choose from.
Port | Purpose | TLS | SSL |
---|---|---|---|
Port | |||
25 | Simple Mail Transfer Protocol Port | Optional | No |
Purpose | |||
80 | Hypertext Transfer Protocol Port | Optional | No |
TLS | |||
465 | Authenticated SMTP over SSL Port | No | Yes |
SSL | |||
587/588 | Email Message Submission Port | Optional | No |
2525 | The Alternative Port | Optional | No |
You can see all the details for these ports below:
Port 25: Simple mail transfer protocol port
Every systems administrator (at least of a certain age), knows that SMTP was designated to use port 25 in IETF Request For Comments (RFC) 821. Today, IANA, still recognizes Port 25 as the standard, default SMTP port. Although port 25 continues to be the most common port for SMTP relaying, most modern SMTP clients could be blocking this port.
Why, you ask?
Port 25 is blocked on many networks because of the spam that has historically been relayed from compromised computers and servers. So, it is true that many ISPs and hosting providers block or restrict SMTP connections on port 25. This helps to cut down a number of unsolicited emails that are sent from their networks.
However, if you are managing an email server you can always decide to leave port 25 open and allow an SMTP connection through it. You can implement other securitization on your server, such as frameworks and additional email verification to prevent the sending of spam.
You can use TLS encryption with port 25 with Mailjet.
Port 80: Hypertext transfer protocol port
Port 80 is the port number assigned to the commonly used internet communication protocol Hypertext Transfer Protocol (HTTP). It is the port from which a computer sends and receives web client-based communication and messages from a web server, and is used to send and receive HTML pages or data. This is the port that the server "listens to" or expects to receive from a web client, assuming that the default was taken when the server was configured or set up.
And you know what the best thing is about using this port? It is open 99.9% of the time! So the chances of your email not getting through are pretty slim. Everybody needs access to the internet and they need this port open.
You can use TLS encryption with port 80 as well.
Port 465: Authenticated SMTP over SSL port
IANA initially assigned port 465 for an encrypted version of SMTP, called SMTPS. By the end of 1998, IANA had reassigned this port number to a new service. But still many services continue to offer the deprecated SMTPS interface on port 465. We are one of these services.
The purpose of port 465 is to establish a port for SMTP to operate using Secure Sockets Layer (SSL). SSL is commonly used for encrypting communications over the internet. Typically, you will use this port only if your application demands it.
This is the best way to use a more secure SMTP connection. Port 465 is the only one with which we are accepting SSL encryption.
Port 587 and Port 588: Email message submission port
Nowadays, port 587 is used for secure submission of email for delivery. Most of the client software are configured to use this port to send your messages. Almost all mail servers support this port. But even if the mail server supports it, it may or may not be open for mail submissions.
With Mailjet, this port is open. To see if it is the same for your destination, you can use the telnet technic.
Using port 587, you can couple it with TLS encryption while using Mailjet. The same applies to port 588.
Port 2525: The alternative port
Port 2525 is not an official SMTP port, and it is not sanctioned by the IETF nor IANA. Almost every ESP supports the use of Port 2525, even though this is not an official SMTP port. It could be used as an alternative to port 587 for SMTP, in case all of the other pots are blocked.
Port 2525 is probably the most used by users that are hosted on Google Compute Engine and experiencing connectivity issues with port 587.
This port also supports TLS encryption.
Mailjet’s SMTP relay
Mailjet's robust delivery infrastructure routes billions of emails to the inbox every month. Our free SMTP relay could be set up in minutes and you will discover just how our powerful features can help you do more with less.
If you’re using Mailjet for sending your transactional emails through SMTP, it is pretty easy to set this up! Once you have created your amazing templates, you can follow this article to configure your SMTP connection. You can do this with any desktop client, such as Outlook or Thunderbird. But even better than that, you can use MTA and MDA, such as Postfix, exim and Exchange.
Of course, you can set up the SMTP relay with any technology that supports SMTP, so you can choose the perfect framework or language for you. What could be easier, right?
Just add your API key as the username and secret key as the password and set up the host/smtp server in-v3.mailjet.com.
What we learned together
Now you can say that you know what an SMTP and network port is – well done, you! Even better, you now know the purpose of some ports and that you can use them for SMTP connections and relays. You can also check if a port is opened in your configuration or the recipient’s one using telnet.
We are sure that, now, if you have any issue with the SMTP relay between Mailjet and your own server, you will know what to test and see if there is an issue with the port connection.
Want to know more about the world of email? Subscribe to our newsletter and get the best tips and ideas in your inbox.