Email rests on three protocols. SMTP sends messages, while POP3 and IMAP fetch them from the server into a mail client. Let's look at how they differ, which ports they use and which protocol to pick for your task.
SMTP: sending mail
SMTP (Simple Mail Transfer Protocol) handles sending. When you click Send, the message goes to an SMTP server, which passes it on down a chain of servers until it reaches the recipient's mailbox.
In short, the process looks like this:
- The mail client connects to the SMTP server.
- The sender authenticates with a login and password.
- The client passes the recipient address and the message itself.
- The server forwards the message on to the recipient.
SMTP works one way only, for sending. Receiving is handled by POP3 and IMAP.
POP3: downloading mail to one device
POP3 (Post Office Protocol version 3) downloads messages from the server to a device and, by default, deletes them from the server.
POP3 pros:
- messages are stored locally and available offline;
- they take no space on the server;
- minimal setup.
POP3 cons:
- a message downloaded to a computer is not visible on a phone;
- if the device breaks, the messages can be lost;
- folders and the read status are not synchronized.
POP3 suits people who work with mail from a single device and do not need synchronization.
IMAP: synchronization across devices
IMAP (Internet Message Access Protocol) keeps messages on the server and synchronizes their state across all devices. Read a message on your phone, and it is marked read on the computer too.
IMAP pros:
- messages and folders are the same on every device;
- everything is stored on the server and available from anywhere;
- you can download only the headers and save traffic.
IMAP cons:
- messages take space on the server;
- an internet connection is required.
IMAP is the default choice for anyone who reads mail from several devices. Today it is used almost everywhere.
Mail protocol ports
Each protocol has two port options: a modern one with TLS encryption and an old one without. Always choose the encrypted port, otherwise the login, password and messages travel over the network in plain text.
| Protocol | Encrypted | Unencrypted |
|---|---|---|
| Sending, SMTP | 465 or 587 | 25 |
| Receiving, IMAP | 993 | 143 |
| Receiving, POP3 | 995 | 110 |
Which SMTP port to pick for sending
Ports 587 and 465 are both meant for a user to send mail with a login and password. Start with 465, and if a client or library does not work with it, try 587.
Port 25 is used between mail servers; it is not suitable for sending from a mail client.
Protocol comparison
| Protocol | Task | When to choose |
|---|---|---|
| SMTP | Sending mail | You need to send a message |
| POP3 | Downloading mail | Work from a single device |
| IMAP | Synchronization | Access from several devices |
The main difference is simple.
SMTP only sends, POP3 and IMAP only receive.
The choice between POP3 and IMAP comes down to whether you need synchronization across devices.
Sending mail on F3 Cloud servers
To keep servers from being used for bulk mailings and spam, sending mail directly over SMTP is closed by default on F3 Cloud servers. Receiving mail over IMAP and POP3 and the work of your web applications are not affected.
Outgoing connections to ports 25, 465 and 587 are closed by default, including connections to external mail services. If you need to send mail from the server, for example messages from a website or your own mail server, contact support.
Our resources
Telegram channel: https://t.me/f3cloud_news
Our website: https://f3cloud.com