SMTP
Simple Mail Transfer Protocol
ELI5 — The Vibe Check
SMTP is the protocol email uses to leave your device and travel to the recipient's mail server. It's like the postal service for email — it handles sending and routing but NOT receiving. To receive email, you use IMAP or POP3.
Real Talk
SMTP is a TCP-based application-layer protocol for sending email. It operates on port 25 (server-to-server), 587 (client submission with STARTTLS), or 465 (SMTPS with TLS). SMTP handles outgoing mail routing between mail servers via MX record lookups.
Show Me The Code
// Send email via SMTP in Node.js (using nodemailer)
const nodemailer = require('nodemailer');
const transporter = nodemailer.createTransport({
host: 'smtp.gmail.com',
port: 587,
secure: false,
auth: { user: 'you@gmail.com', pass: 'password' }
});
await transporter.sendMail({
from: 'you@gmail.com',
to: 'them@example.com',
subject: 'Hello!',
text: 'Working SMTP!'
});
When You'll Hear This
"Configure the SMTP server to send transactional emails." / "SMTP port 25 is blocked by most ISPs to prevent spam."
Related Terms
IMAP (Internet Message Access Protocol)
IMAP is how your email client fetches email from the server.
MX Record (Mail Exchange Record)
An MX record tells the internet where to deliver emails for your domain. When someone sends an email to you@yoursite.
POP3 (Post Office Protocol version 3)
POP3 is the old-school way to receive email. It downloads all your emails to your device and (by default) deletes them from the server.
Port
A port is like an apartment number on a building. Your computer is the building (localhost), and multiple services live inside.
TLS Handshake (Transport Layer Security Handshake)
The TLS handshake is the 'hello, do we trust each other?' ceremony that happens before any HTTPS data flows.