Quick Answer

SMTP (Simple Mail Transfer Protocol) is the standard protocol for sending email between servers. Defined in RFC 5321, SMTP handles the transfer of email from the sending server to the receiving server via a series of commands (HELO, MAIL FROM, RCPT TO, DATA). SMTP operates on port 25 for server-to-server delivery, port 587 for authenticated submission, and port 465 for implicit TLS submission.

What Is SMTP (Simple Mail Transfer Protocol)?

By Braedon·Mailflow Authority·definitions

SMTP: The Language of Email

SMTP is the protocol that moves email from one server to another. Every email you've ever sent was delivered via SMTP — whether through Gmail, an ESP like SendGrid, or a self-hosted server.

SMTP was defined in 1982 (RFC 821) and updated in 2008 (RFC 5321). It's simple by design — a text-based protocol with a handful of commands.

How SMTP Works

An SMTP conversation between two servers looks like this:

Client: EHLO mail.example.com
Server: 250 Hello

Client: MAIL FROM:<[email protected]>
Server: 250 OK

Client: RCPT TO:<[email protected]>
Server: 250 OK

Client: DATA
Server: 354 Start mail input

Client: Subject: Test
Client: This is the message body.
Client: .
Server: 250 OK: queued

Client: QUIT
Server: 221 Bye

That's it. SMTP is fundamentally a conversation between two servers exchanging commands and responses.

SMTP Ports

PortPurposeEncryption
25Server-to-server deliveryOptional (STARTTLS)
587Client submission (standard)Required (STARTTLS)
465Client submission (implicit TLS)Required (TLS)
2525Alternative (when 587 blocked)Varies

Port 587 is what you configure in your application or email client for sending through an ESP or SMTP relay.

SMTP Response Codes

Every SMTP response starts with a three-digit code:

  • 2xx — Success (250 OK, 220 Service ready)
  • 3xx — Intermediate (354 Start mail input)
  • 4xx — Temporary failure (421 Try again later, 450 Mailbox busy)
  • 5xx — Permanent failure (550 User not found, 553 Relay denied)

For complete code references, see SMTP response codes explained.

SMTP Authentication

Raw SMTP has no authentication — any server can claim to be anyone. Authentication was added through:

  • SMTP AUTH — username/password authentication for relay access
  • SPF — DNS record authorizing sending IPs
  • DKIM — cryptographic message signatures
  • DMARC — policy enforcement and alignment

Read more: SMTP authentication explained.

Practitioner note: When debugging email delivery, the SMTP conversation tells you exactly what's happening. Learn to use openssl s_client -connect server:587 -starttls smtp to test connections manually. It's the fastest way to diagnose relay issues.

Practitioner note: Port 25 is blocked by default on almost every cloud provider (AWS, GCP, Azure). If you're self-hosting and can't send email, this is the first thing to check. Use port 587 through a relay, or request port 25 unblocking from your provider.

For relay setup and troubleshooting, see the SMTP relay troubleshooting guide.

Need help configuring SMTP infrastructure? Schedule a consultation — I'll set up reliable SMTP delivery for your applications.

Sources


v1.0 · April 2026

Frequently Asked Questions

What ports does SMTP use?

Port 25 is for server-to-server email delivery. Port 587 is for email submission (client to server) with STARTTLS. Port 465 is for implicit TLS submission. Most ESPs and SMTP relay services use port 587 for sending.

What's the difference between SMTP and IMAP?

SMTP sends email. IMAP (and POP3) retrieves email. When you send a message, it goes out via SMTP. When you check your inbox, your client uses IMAP to download messages from the server. They're complementary, not alternatives.

What is an SMTP relay?

An SMTP relay is a server that forwards email on behalf of another server. Instead of your application connecting directly to Gmail's servers, it sends to the relay (like SendGrid or Mailgun), which handles delivery. Relays provide better deliverability and reputation management.

What are SMTP response codes?

Numeric codes the receiving server returns during the SMTP conversation. 2xx means success (250 OK). 4xx means temporary failure (421 Try again later). 5xx means permanent failure (550 User not found). These codes are critical for diagnosing delivery issues.

Is SMTP secure?

SMTP was designed without encryption. STARTTLS was added to upgrade connections to TLS, but it's opportunistic — if encryption fails, email sends in plaintext. MTA-STS makes TLS mandatory. For most modern email, TLS is used but not guaranteed.

Want this handled for you?

Free 30-minute strategy call. Walk away with a plan either way.