SMTP stands for Simple Mail Transfer Protocol. SMTP is a set of communication guidelines that allow the software to transmit electronic mail over the internet is called Simple Mail Transfer Protocol. It is a program used for sending messages to other computer users based on email addresses.
IMAP and POP3 are other protocols used for email transmission, but email clients mainly use them, whereas SMTP is used for email servers.
So let's see, What is SMTP(Simple Mail Transfer Protocol)?
SMTP or Simple Mail Transfer Protocol is a mail transfer protocol used to transfer email between servers in a simple text-based mechanism. Email servers and some email clients use SMTP for email transfer and communication.
Ports 25, 465, 587, or 2525 for SMTP have all been considered standard SMTP ports at some point, but only 587 or 2525 really should be regarded for everyday use.
SMTP Ports 25
SMTP port 25 was the first official port and continues to be used primarily for SMTP relaying. SMTP relaying is the transmission of email from email server to email server. In most cases, modern SMTP email clients (Microsoft Outlook, Mail, Thunderbird, etc.)
As an old, popular, and well-known port, Port 25 is abused widely. Some ISP, Network, and Cloud providers automatically or by default block the TCP 25 SMTP port to prevent abuses and security attacks.
SMTP Port 587
Port 587 is another SMTP submission port supported by the vast majority of servers and will reduce the rate of rejected messages. If you do not know the default port of the remote email server, the best choice to start for submission using the SMTP port 587. It also provides a secure email submission by using TLS encryption.
SMTP Port 465
Port 465 is for SMTPS. SSL encryption is started automatically before any SMTP level communication. SMTP port was the first secure and encrypted email submission port which is using SMTP over SSL methodology.
SMTP Port 2525
SMTP Port 2525 is used for the secure submission of emails for delivery by modern ESPs. Port 2525 is an alternate port, which mirrors port 587, in the case the other mentioned ports blocked. This port is not endorsed by the IETF nor IANA.
How can you find out what your SMTP port is?
The configuration files can be found in /etc/pmta/config on a Linux server and C:\pmta\config. that on Windows Server.
smtp-listener 10.0.1.22:587 # listens on port 587 and IP 10.0.1.22
We can use telnet to check the remote SMTP ports like 25, 587, 465, 2525 or another port. Telnet is a simple command-line tool that is used for remote shell connection and management.
For example, we will check the Gmail SMTP ports where the SMTP service is provided with the smtp.google.com domain name.
$ telnet smtp.gmail.com 25 $ telnet smtp.gmail.com 587 $ telnet smtp.gmail.com 465 $ telnet smtp.gmail.com 2525
SMTP Port Communication Example
SMTP is mainly a text-based protocol where management is done via text or ASCII command. When connected, an SMTP port commands like EHLO, STARTTLS, SIZE, etc can be used.
- EHLO command is the reverse form of the helo and used to get command information about the SMTP server.
- SIZE command is used to set the email message or data size we want to send.
- STARTTLS command is used to start TLS encrypted secure communication. 250 – STARTTLS means the SMTP port can accept TLS connections.
$ telnet smtp.rootadminz.com 587 Trying 18.104.22.168... Connected to smtp.rootadminz.com. Escape character is '^]'. 220 ESMTP SMTPNY-LB1 Ready 500 5.5.2 Error: bad syntax ehlo rootadminz.com 250-smtpny-lb1.rootadminz.com 250-PIPELINING 250-SIZE 50000000 250-VRFY 250-ETRN 250-STARTTLS 250-AUTH PLAIN LOGIN 250-AUTH=PLAIN LOGIN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN STARTTLS 220 2.0.0 Ready to start TLS
SMTP Port Security and SSL/TLS Connection
SMTP uses the SSL/TLS certificates to secure and encrypt SMTP connection. OpenSSL command provides the s_client command to test and connect remote SMTP service with an SSL/TLS connection. We will also provide the removed SMTP server domain name and port number like below using the -connect option. SSL/TLS encrypted SMTP connection is named as SMTPS.
$ openssl s_client -starttls smtp -crlf -connect smtp.mailgun.org:587
Popular Mail Service Providers SMTP Port Numbers
There is a lot of different email service and server providers which provides SMTP service via SMTP ports. Below you can find popular SMTP service providers SMTP port numbers.
|SMTP Provider||SMTP Server Address||SMTP Ports|
|Google or Gmail||smtp.gmail.com||465, 87|
|Yahoo Mail Plus||plus.smtp.mail.yahoo.com||465|