Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

What Is SMTP? How It Sends Email

· 5 min read · Home Tech

In this article
  1. Background and Origin
  2. How SMTP Works
  3. SMTP Ports and Security
  4. Common SMTP Problems and Solutions
  5. SMTP vs. IMAP and POP3
  6. How to Choose SMTP Settings
  7. Frequently Asked Questions

SMTP stands for Simple Mail Transfer Protocol, and it is the standard protocol used to send email across the internet. It works as the delivery system that moves your outgoing messages from your email client (like Outlook or Gmail's web interface) to the recipient's mail server. While you might not see it, every time you hit "send," SMTP is the underlying technology that gets the message on its way.

Background and Origin

SMTP was first defined in 1982 in RFC 821, replacing the older Mail Transfer Protocol. It was designed to be a simple, text-based protocol that could reliably transfer email between servers. Over the years, it has been extended—most notably with SMTP AUTH (for authentication) and STARTTLS (for encryption)—but the core concept remains the same: a set of commands that an email client or server uses to transmit message data.

Today, SMTP is maintained by the Internet Engineering Task Force (IETF) and is documented in RFC 5321, which is the current specification. It works alongside other protocols like POP3 and IMAP, which are used for receiving email. SMTP handles the "push" of messages, while POP/IMAP handle the "pull" of messages to your device.

How SMTP Works

SMTP operates on a client-server model. Here's a simplified step-by-step of what happens when you send an email:

  1. Your email client (the SMTP client) connects to your outgoing mail server (the SMTP server) on port 25, 465, or 587. Port 587 is the modern standard for message submission, often with STARTTLS encryption.
  2. The client issues commands like HELO (or EHLO for extended SMTP), MAIL FROM, RCPT TO, and DATA to specify the sender, recipient, and the message content.
  3. The server verifies that you are allowed to send (using authentication if required) and then accepts the message.
  4. The server then looks up the recipient's domain via DNS (MX records) and delivers the message to the recipient's mail server, again using SMTP.
  5. The recipient's server stores the message until the recipient retrieves it via POP3 or IMAP.

This process is sometimes called a "store-and-forward" system because messages are held temporarily at each hop until the next server accepts them.

SMTP Ports and Security

SMTP uses different ports depending on the level of security and the purpose:

  • Port 25: The original SMTP port, used for server-to-server communication. Most ISPs block this port for client submissions to prevent spam.
  • Port 465: SMTPS, which is SMTP over SSL/TLS from the start. This is used by some providers for secure submission.
  • Port 587: The standard submission port, often with STARTTLS. This is what most email clients use to send mail.
  • Port 2525: An alternate port used by some services when 587 is blocked.

For security, SMTP AUTH (authentication) requires a username and password, and STARTTLS encrypts the connection. Without encryption, your email content and credentials could be intercepted. Most modern email providers require TLS encryption for both submission and relay.

Common SMTP Problems and Solutions

If you're having trouble sending email, here are common issues and how to fix them:

  • Authentication errors (535, 534): Your username or password is incorrect, or your app is not using an app-specific password. Check your credentials and make sure you're using the correct SMTP settings.
  • Connection timeouts: Your ISP might be blocking port 25 or 587. Try using port 2525 or contact your provider.
  • Relay denied (550): The server is refusing to relay for your domain. This usually means you're not authenticated or you're trying to send from an unauthorized address.
  • Certificate errors: The server's SSL certificate is invalid or expired. This can happen with misconfigured servers; verify the server name matches the certificate.

If you're setting up an email client, double-check the outgoing server settings from your provider's help page. Labels can differ slightly by version or device, but the core settings are the same.

SMTP vs. IMAP and POP3

SMTP is often confused with IMAP and POP3, but they do different jobs:

  • SMTP is for sending email. It pushes messages from your client to the server and between servers.
  • IMAP is for receiving and synchronizing email across multiple devices. It keeps messages on the server and lets you access them from anywhere.
  • POP3 is for downloading email to a single device. It typically removes messages from the server after download.

In practice, you use SMTP for outbound mail and either IMAP or POP3 for inbound mail. Most email clients require you to configure both.

How to Choose SMTP Settings

When configuring an email client, you'll need the correct SMTP server address and port. Here's what to consider:

  • Use your provider's official settings: For Gmail, it's smtp.gmail.com with port 587 (or 465). For Outlook.com, it's smtp-mail.outlook.com on port 587. Always check the provider's official help page.
  • Authentication is required: Most providers require you to use your full email address as the username and an app password if you have two-factor authentication enabled.
  • Encryption: Choose STARTTLS on port 587 or SSL on port 465. Never use unencrypted connections if you can avoid it.

If you're using a custom domain, your email hosting provider will give you the SMTP server address, which is often something like mail.yourdomain.com.

Frequently Asked Questions

Is SMTP the same as email?

No. SMTP is just the protocol used to send email. Email also relies on other protocols like IMAP or POP3 for receiving, and DNS for routing. SMTP is only the delivery mechanism for outgoing mail.

What does SMTP stand for?

It stands for Simple Mail Transfer Protocol. Despite the word "simple," it's a robust protocol that has been in use since 1982 and continues to be the backbone of email delivery.

Can I use SMTP without a username and password?

Technically, some servers allow open relay without authentication, but this is extremely rare and insecure. Modern email providers require authentication to prevent spam and unauthorized use. You should always use authentication.

Why is port 25 blocked?

Port 25 is often blocked by ISPs to prevent home users from running their own email servers and sending spam. For sending email from a client, you should use port 587 or 465, which are designed for authenticated submission.

What is STARTTLS?

STARTTLS is a command that upgrades an existing plaintext SMTP connection to an encrypted TLS connection. It's a way to add security without requiring a separate port. Most modern SMTP servers support it on port 587.

Does SMTP work for receiving email?

No. SMTP is only for sending and relaying email. Receiving email is handled by POP3 or IMAP, which download messages from the server to your device. Some servers use SMTP to deliver messages to a local mailbox, but that's an internal detail.