Skip to content
Email basics November 4, 2026 · 3 min read · By Smailor Team

Also in FrançaisEspañolDeutsch

What is SMTP? How email actually gets sent

SMTP (Simple Mail Transfer Protocol) is the protocol that moves email from one server to the next. It only sends. Reading your mail is the job of IMAP or POP3, which is why a mail app asks for two server addresses.

The path of a message

  1. Your mail app hands the message to your provider's SMTP server. This step is called submission.
  2. That server looks up the recipient domain's MX record.
  3. It connects to the server named there and passes the message over SMTP.
  4. The receiving server files it in the mailbox.

There can be more hops in between, such as a filtering service or a forward. Each one adds a line at the top of the headers.

What a session looks like

SMTP is plain text, and you can read a conversation between two servers. S is the receiver and C the sender:

S: 220 mx.example.com ESMTP
C: EHLO mail.sender.com
S: 250-mx.example.com
S: 250 STARTTLS
C: MAIL FROM:[email protected]
S: 250 OK
C: RCPT TO:[email protected]
S: 250 OK
C: DATA
S: 354 End data with a single dot
C: (headers and body)
C: .
S: 250 OK queued
C: QUIT

Every line from the server begins with a status code. A real session also adds STARTTLS for encryption right after the greeting.

The envelope and the letter

MAIL FROM and RCPT TO form the envelope, which is what servers use for routing. The From: and To: you see in your mail app are inside the letter, and nothing forces them to match. That split explains two everyday things:

  • BCC works because blind recipients exist on the envelope only.
  • Anyone can write any From: line, which is the reason SPF, DKIM and DMARC exist.

Which port to use

Port Use Encryption
587 Sending from an app (submission) STARTTLS, upgraded after connecting
465 Sending from an app (submission) TLS from the first byte
25 Server to server Opportunistic STARTTLS

For an app or a website, use 587 or 465 with a username and password. Do not use 25: most cloud hosts and home internet providers block it to limit spam, which is the usual reason a script "cannot connect" while the same settings work elsewhere.

Frequently asked questions

Is SMTP secure?

The original protocol sends everything in clear text. Modern servers add TLS, and submission on 587 or 465 requires it. Between servers, encryption is usually present but not always guaranteed.

Can I send through SMTP without a mail server of my own?

Yes. Your mailbox provider gives you SMTP settings for this. A website or an app logs in with them and sends through that server.

Why does my app say "authentication failed"?

The username is usually the full address, and some providers require an app password rather than your normal one, particularly when two-factor login is on.

Smailor gives each mailbox on a verified domain its own SMTP settings, so that a mail app or your website can send from your address with an ordinary login.