If you've ever configured an email client manually, you've probably come across both IMAP and SMTP.
The difference is simple: SMTP is used to send email. IMAP is used to access and manage email stored on a mail server.
They aren't competing protocols. They handle different parts of the email flow and are commonly used together.
IMAP vs SMTP at a glance
| IMAP | SMTP | |
|---|---|---|
| Full name | Internet Message Access Protocol | Simple Mail Transfer Protocol |
| Main purpose | Access and sync email | Send and relay email |
| Typical direction | Mail server to email client | Email client to server, and server to server |
| Manages mailboxes | Yes | No |
| Syncs folders and message state | Yes | No |
| Sends new messages | No | Yes |
| Common secure port | 993 | 465 or 587 |
| Current core standard | IMAP4rev2, RFC 9051 | SMTP, RFC 5321 |
The easiest way to remember the difference is:
SMTP moves the message. IMAP lets you access it after it reaches a mailbox.
What is IMAP?
IMAP, or Internet Message Access Protocol, is a standard for accessing and managing email stored on a mail server.
With IMAP, the server remains the central source of mailbox data. Your email client can retrieve messages, search them, organize them into folders, and synchronize changes such as whether a message has been read, moved, or deleted.
That makes IMAP particularly useful when the same mailbox is accessed from multiple devices.
For example, if you read an email on your phone and later open your inbox on your laptop, the message can already appear as read because both clients are synchronizing with the same server-side mailbox.
The current standard is IMAP4rev2, defined in RFC 9051.
What does IMAP actually do?
IMAP can handle tasks such as accessing messages, checking for new mail, searching a mailbox, managing folders, setting message flags, and retrieving only the parts of a message that a client needs.
What it does not do is send new email.
That's where SMTP comes in.
What is SMTP?
SMTP, or Simple Mail Transfer Protocol, handles the sending and transfer of email.
When an email is sent, SMTP or the closely related message-submission process is responsible for getting that message from the sender toward the recipient's mail system. SMTP is also used to transfer messages between mail servers.
We cover the protocol, SMTP infrastructure, ports, commands, error codes, and delivery process in detail in our What is SMTP, and how does it work? guide.
For this comparison, the important distinction is simply:
SMTP handles outgoing mail. IMAP provides access to mail that has already been delivered to a mailbox.
How do IMAP and SMTP work together?
A typical email journey looks like this:
| Step | What happens | Protocol |
|---|---|---|
| 1 | You click Send in your email client | SMTP submission |
| 2 | Your mail provider sends or relays the message toward the recipient's mail server | SMTP |
| 3 | The recipient's mail system accepts and stores the message | Mail server |
| 4 | The recipient opens their inbox and accesses the stored message | IMAP |
| 5 | Changes such as read status or folder moves are synchronized with the server | IMAP |
So when an email client asks you for both an incoming mail server and an outgoing mail server, it is usually asking for two different services.
The outgoing server uses SMTP. The incoming server may use IMAP.
Not every modern webmail application communicates with its backend using IMAP and SMTP directly, but these protocols remain widely used for mail clients, servers, and integrations.
IMAP vs SMTP ports
IMAP and SMTP use different ports because they provide different services.
IMAP ports
Port 993 is the standard port for IMAP over implicit TLS. Encryption begins as soon as the connection is established.
Port 143 is the traditional IMAP port. It can support STARTTLS, which upgrades the connection to TLS.
For modern email access, encrypted connections should be used.
SMTP ports
SMTP has several commonly encountered ports depending on whether a message is being submitted by a client or relayed between servers.
Port 587 is commonly used for authenticated message submission and usually uses STARTTLS.
Port 465 is used for message submission with implicit TLS.
Port 25 is primarily used for SMTP relay between mail servers.
If you're configuring an account, follow the port and security settings supplied by your email provider rather than choosing a port based only on the protocol name.
IMAP vs POP3 vs SMTP
POP3 often appears alongside IMAP and SMTP, but it has a different role.
Like IMAP, POP3 is used to retrieve email rather than send it. The main difference is how it approaches mailbox access.
| IMAP | POP3 | SMTP | |
|---|---|---|---|
| Primary purpose | Access and sync email | Download email | Send email |
| Server-side mailbox management | Yes | Limited | No |
| Multi-device synchronization | Designed for it | Limited | Not applicable |
| Sends email | No | No | Yes |
POP3 uses a simpler download-oriented model. IMAP provides richer synchronization and server-side mailbox management, which generally makes it better suited to accessing the same mailbox across multiple devices.
SMTP works alongside either protocol because neither IMAP nor POP3 is responsible for sending mail.
Do you need both IMAP and SMTP?
If you're configuring a traditional email client that needs to both send and receive messages, usually yes.
SMTP handles outgoing mail while IMAP handles access to incoming and stored mail.
But developers don't necessarily need to work with either protocol directly.
An application that only sends transactional emails might use an SMTP service or an email-sending API. An application that needs to read and manage a user's mailbox might use IMAP or a provider-specific email API.
The right interface depends on what the application needs to do.
IMAP, SMTP and email testing
IMAP can be used in automated tests to retrieve messages from a mailbox, but it isn't always the easiest interface for test automation.
Automated tests typically need to do something more specific:
Trigger an application action, wait for the resulting email, retrieve it, and assert that the recipient, subject, content, links, or authentication results are correct.
For this type of workflow, an email testing API can avoid the need to maintain IMAP connections and mailbox state.
testmail.app creates programmable test inboxes using namespaces and tags:
{namespace}.{tag}@inbox.testmail.app
The tag can be generated dynamically for each test, so separate test runs can use separate email addresses without creating mailboxes in advance.
Emails can then be retrieved through testmail.app's JSON or GraphQL API and filtered by namespace, tag, timestamp, and other fields. That makes the inbox easier to work with from automated testing frameworks and CI/CD pipelines.
For a broader look at this workflow, see our Automated email testing: A complete guide and Email testing 101.
IMAP vs SMTP: which one should you use?
There isn't really an IMAP-versus-SMTP decision because the protocols solve different problems.
Use SMTP when you need to send or transfer email.
Use IMAP when you need to access, organize, and synchronize email stored in a mailbox.
Use both when an email client needs full sending and mailbox functionality.
For application development and automated testing, you may also choose an email API instead of working directly with IMAP or SMTP, depending on the workflow.
Frequently asked questions
What is the difference between IMAP and SMTP?
SMTP sends and transfers email, while IMAP accesses and synchronizes email stored on a mail server. They are complementary protocols, not alternatives. A typical email client uses SMTP to send messages and IMAP to access received mail.
Is IMAP for incoming or outgoing email?
IMAP is used for incoming and stored email. It lets an email client access messages on a mail server and synchronize folders, read status, flags and other mailbox changes across devices. IMAP does not send new messages.
Is SMTP for incoming or outgoing email?
SMTP is primarily used for outgoing email. It handles message submission from email clients and applications, as well as message transfer between mail servers.SMTP can also receive a message from another SMTP server during delivery, but it does not provide access to a user's mailbox.
Do I need both IMAP and SMTP?
Usually, yes, if an email client needs to both send and receive email. SMTP handles sending, while IMAP handles access to received and stored messages. Applications that only send email may only need SMTP or an email-sending API.
Is IMAP better than SMTP?
Neither is better because IMAP and SMTP do different jobs. Use SMTP to send email and IMAP to access and synchronize a mailbox. They are commonly used together rather than chosen as alternatives.
Can IMAP send email?
No. IMAP cannot send new email. It is designed to access and manage messages that are already stored in a mailbox. Sending email requires SMTP or another sending method such as an email API.
Can SMTP receive email?
SMTP servers can receive messages from other SMTP servers as part of email delivery, but SMTP does not let users read or manage their inboxes. Mailbox access is handled separately using IMAP, POP3, webmail or an email API.
What ports do IMAP and SMTP use?
IMAP commonly uses port 993 for implicit TLS and port 143 with STARTTLS. SMTP commonly uses ports 587 or 465 for message submission and port 25 for server-to-server relay. Use the port and encryption settings recommended by your email provider.
What is the difference between IMAP, POP3 and SMTP?
SMTP sends email, while IMAP and POP3 are used to access received email. IMAP keeps mailbox data on the server and synchronizes changes across devices. POP3 uses a simpler download-oriented model and does not provide the same server-side synchronization. For most modern multi-device email clients, IMAP is the more common choice for mailbox access.
Should developers use IMAP, SMTP, or an email API?
It depends on the task. Use SMTP when an application needs to send email. Use IMAP when it needs to access and manage a mailbox. For automated workflows such as email testing, an email API can be simpler because tests can retrieve and inspect messages using structured requests instead of maintaining mailbox connections and state.