Definitions

What is SMTP?

Last updated:

SMTP stands for Simple Mail Transfer Protocol. It's the standard protocol for sending emails. You can think of it as a postal service for your digital messages. When an application sends an email, this protocol moves the email from one mail server to another.

This protocol has been around since 1982, making it one of the oldest internet protocols still actively used today. While email technology has evolved tremendously since then, it remains the foundation of email delivery. Simple Mail Transfer Protocol works together with authentication methods like DKIM, SPF, and DMARC to ensure your emails not only get delivered, but also land safely in the inbox rather than spam.

In addition to our API, Lettermint also offers SMTP relay for sending both transactional emails and broadcast emails. In this article, we'll explain how the protocol works, which ports to use, and why proper configuration matters for delivering your emails.

How SMTP works

The sending process consists of several steps that together handle email delivery. When you send an email, here's what happens:

  1. Making a connection: Your email client or application connects to a server. This can be your own mail server or a service like Lettermint.
  2. Authentication: The server verifies you have permission to send emails using a username and password.
  3. Transferring the email: Your application hands over the email to the server, including sender, recipient, and message content.
  4. DNS lookup: The server uses DNS to find out which mail server is responsible for receiving emails for the recipient's domain.
  5. Connecting to receiving server: The server establishes a connection with the recipient's mail server and attempts to deliver the email.
  6. Delivery or queue: If the receiving server is available, the email gets delivered immediately. Otherwise, the email stays in the queue for another attempt.

This entire process usually takes just a few seconds. When issues occur like greylisting, delivery may take a bit longer.

Who uses this protocol?

Everyone who sends email uses this system. The approach varies depending on the situation.

As an individual

You send emails through your email provider's server. When you send an email from Gmail, Outlook, or Apple Mail, your email client connects behind the scenes with a server (like smtp.gmail.com) to send that email.

As a developer

You have multiple options. Connect directly with a service like Lettermint, or use your hosting provider's server. Many hosting providers offer their own server that lets you send emails from your application.

As a business

Companies often choose an email service like Lettermint to ensure their emails arrive. This provides better control over email delivery than a hosting provider. Some companies also run their own infrastructure for complete control, think of a bank or government institution.

In all cases, the principle stays the same: the protocol moves your email from one server to another. Whether you're sending a personal email or thousands of transactional emails per day from an application.

SMTP ports

The protocol uses different port numbers to connect with a mail server. Each port has a specific purpose and gets used in different situations.

PortPurposeEncryptionWhen to use?
25Communication between mail serversOptionalOnly for server-to-server traffic. Often blocked by providers.
587Send email with authenticationSTARTTLSRecommended for sending from applications and email clients.
465SSL connectionSSL/TLS from startAlternative to port 587 with direct encryption.
2525Alternative to port 587STARTTLSBackup when port 587 is blocked.
2587Alternative to port 587STARTTLSBackup when port 587 is blocked.
2465Alternative to port 465SSL/TLS from startBackup when port 465 is blocked.

Why not port 25?
Many providers block port 25 to prevent spam. Spammers used to send massive amounts of email through port 25 without authentication. By blocking this port, providers make it harder to send spam.

Which port should you use?

Port 587 and 465 are the best choices for sending email. Port 587 uses STARTTLS (connection starts unencrypted then switches over), while port 465 uses SSL/TLS directly from the start. Both are secure, but port 587 is the more modern standard.

At Lettermint, we use both port 587 and 465 for secure and reliable email delivery. Besides these two ports, we offer several additional ports. Read more in our SMTP documentation.

Port 25 is mainly intended for communication between mail servers. You usually can't use this port for sending emails from an application.

Authentication

Authentication verifies that only authorized users can send emails through a mail server. Without this verification, anyone could abuse the server to send spam.

How does authentication work?

When connecting to a server, you need to log in with a username and password before you can send an email. The server verifies your credentials and then grants permission to send emails.

Most servers use one of these authentication methods:

MethodDescription
PLAINUsername and password are sent (encrypted via TLS)
LOGINSimilar to PLAIN, but with a different format
CRAM-MD5Password is sent encrypted without being visible in plain text

With Lettermint, we support all the authentication methods above.

Difference between SMTP, POP3, and IMAP

SMTP, POP3, and IMAP are three protocols you often encounter when setting up your email address in email programs. Email providers and internet providers use these protocols together, but they each have a different function.

ProtocolFunctionWhen used?
SMTPSend emailWhen you send an email to a recipient
POP3Retrieve and download emailWhen you want to download emails to your computer or phone
IMAPSynchronize emailWhen you want to read emails on multiple devices

Example: you want to send an email from your email program (like Apple Mail, Spark, or Outlook).

  1. Your email program uses SMTP to send the email to the recipient's mail server
  2. The recipient uses POP3 or IMAP to retrieve the email from their own mail server
  3. With POP3, the email gets downloaded and often removed from the server
  4. With IMAP, the email stays on the server and you can read it from any device

Simple Mail Transfer Protocol is needed to send emails. POP3 and IMAP are only needed for retrieving emails you receive.

At Lettermint, we focus entirely on sending emails. We don't manage mailboxes, which means POP3 and IMAP don't apply when using Lettermint.

Conclusion

Simple Mail Transfer Protocol handles sending emails between servers. To send emails, you need a server, with port 587 and 465 being the most common and secure options.

Authentication prevents unauthorized users from abusing the server. Encryption like STARTTLS or SSL/TLS protects your login credentials and email content during transmission.

At Lettermint, we provide this infrastructure for sending transactional and broadcast emails. Our European servers deliver your emails securely and quickly, without you needing to manage your own mail server.

Need more help?

Can't find what you're looking for?

If you couldn't find the information you were looking for, please don't hesitate to reach out to us. Our team is here to assist you with any questions you may have.