SMTP Server

  • Post author:Written by Sara

What Is an SMTP Server?

Definition

An SMTP server is the software that accepts your outgoing email and passes it toward the recipient’s mail system, using Simple Mail Transfer Protocol. It only sends. Fetching mail into an inbox is a different job, done by IMAP or POP.

Two different roles share the name. A submission server takes mail from your client once you have authenticated. A relay hands mail between mail systems. Which one you are talking to is decided by the port.

  • Also calledMail transfer agent, outgoing mail server
  • ProtocolSMTP, defined in RFC 5321
  • Submission ports587 with STARTTLS, 465 with implicit TLS
  • Cannot doRetrieve mail, which is what IMAP and POP are for

How an SMTP Server Sends a Message

SMTP is a conversation. Your client talks, the server answers with a number, and each step either advances or stops there.

  1. EHLO. Your client introduces itself and asks what the server supports, including whether it offers TLS and authentication.
  2. MAIL FROM. The envelope sender is declared. This is the address bounces return to.
  3. RCPT TO. The recipient is named. The server accepts or rejects here, which is the step email verification listens to.
  4. DATA. Headers and body are transferred, then a full stop on its own line ends the message.

The server answers each command with a response code. Read those codes and most sending problems explain themselves.

SMTP Ports and What Each One Does

Three ports matter, and most advice about them is a decade out of date.

Port Role Encryption Use it when
587 Submission, client to server STARTTLS Default for sending apps and tools
465 Submission over implicit TLS TLS from the first byte Your provider offers it, or STARTTLS is being stripped
25 Relay, server to server Opportunistic Running your own mail server, not an app
2525 Unofficial fallback Varies Your host blocks the others, as some do

Port 465 Was Never Un-Deprecated by Accident

You will still read that 465 is dead and 587 is the only correct choice. That has not been true since January 2018.

RFC 8314 made 465 the submissions service, where the TLS handshake begins immediately, and it recommends implicit TLS over STARTTLS. It also says clients and servers “SHOULD implement both STARTTLS on port 587 and Implicit TLS on port 465 for this transition period”.

The same document is blunt that the security difference is small: there is “no significant difference between the security properties” of the two when implementations are correct. So use whichever your provider documents, and stop treating the choice as a deliverability lever.

Port 25 is for relay between mail systems, not for your application. RFC 6409 reserves 587 for submission and notes that “many sites now prohibit outbound traffic on the standard SMTP port”. Most consumer ISPs and cloud hosts block outbound 25 by default, so if a script will not connect, that block is the first thing to check rather than your credentials.

SMTP Response Codes Worth Knowing

The first digit carries the meaning, and the difference between 4 and 5 decides what happens next.

Code Means What happens
250 Accepted Command succeeded
421 Service unavailable, closing Often rate limiting, retry later
450 / 451 / 452 Temporary failure Soft bounce, sender retries for days
550 Mailbox unavailable Hard bounce, suppress the address
554 Transaction failed Often reputation or content rejection

A 4xx is not a failure yet, which is why bounce reports lag. A 5xx is final, and sending to that address again is how bounce rates climb into trouble.

Envelope Sender vs From Header

These are two different addresses and people conflate them constantly.

  • Envelope sender. Declared in MAIL FROM, recorded as Return-Path. Bounces go here, and SPF checks this domain.
  • From header. Inside the message, and the only one your recipient sees. DMARC alignment compares it against the authenticated domain.

They can legitimately differ, which is how mailing lists and sending platforms work. When they differ without alignment, DMARC is what fails.

SMTP Relay vs Open Relay

A relay accepts a message and passes it onward. That is normal and necessary.

An open relay accepts mail from anyone, for anyone, with no authentication. In the 1990s that was the default configuration. Today it gets your IP on blocklists within hours, because spammers scan for exactly this.

Any SMTP server you send through should require authentication. If yours does not, that is not a feature.

Choosing an SMTP Server for Cold Outreach

The protocol is the same everywhere. What differs is the reputation attached to the IP and domain you send from.

  • Your mailbox provider. Google Workspace or Microsoft 365, sending as you. Best reputation, lowest daily limits.
  • A relay service. Built for volume with its own IP pools, and the shared ones carry other senders’ behaviour with them. Worth reading up on dedicated and shared IPs before choosing.
  • Self-hosted. Full control, and full responsibility for warming an IP with no history. Rarely worth it for outreach.

Whichever you pick, authentication has to line up. An SMTP server will happily send mail that SPF, DKIM and DMARC then reject at the other end, and it will report 250 while doing it.

Bottom Line

An SMTP server hands your message to the recipient’s mail system and tells you, in a number, what it thought.

Send on 587 or 465, whichever your provider documents, and stop worrying about which. Keep 25 for server-to-server relay. Treat 5xx as final and suppress the address, treat 4xx as a retry, and watch the gap between the two.

Then remember what a 250 does not mean. It confirms the server accepted the message, not that anyone will see it.

FAQs

1- What does an SMTP server actually do?

It accepts outgoing mail from your client or application and passes it toward the recipient’s mail system, answering each step with a response code. It does not retrieve mail, which is what IMAP and POP handle.

2- Should I use port 587 or 465?

Either. RFC 8314 recommends implicit TLS on 465 and says servers should support both during the transition, while noting there is no significant security difference when both are implemented correctly. Follow your provider’s documentation.

3- Why can my script not connect on port 25?

Because most ISPs and cloud hosts block outbound port 25 by default. It is the relay port for server-to-server traffic, not the submission port your application should use.

4- What is the difference between an SMTP server and an email service provider?

The server is the sending machinery. A provider wraps that in authentication, IP reputation management, tracking and sending limits. You send through a provider, but an SMTP server does the transfer.

5- Does a 250 response mean my email was delivered?

No. It means the server accepted responsibility for the message. It can still be filtered to spam or discarded afterwards, which is why acceptance and inbox placement are measured separately.

6- What is an open relay?

An SMTP server that accepts mail from anyone to anyone without authentication. Spammers scan for them, so an open relay lands on blocklists quickly. Any server you send through should require credentials.

Related Terms