Bookmarks

SMTP — Simple Mail Transfer Protocol

A text-based application-layer protocol that mail programs use to send messages and pass them between servers over TCP.

Also: SMTP, ESMTP

checked 9 Nov

All terms

SMTP is the language mail servers use to agree on handing over a message: who the sender is, who the recipient is and what the message contains. The client sends text commands, and the server replies with three-digit codes.

The dialogue

textA simplified dialogue (S is the server, C is the client)
S: 220 mx.example.net ESMTP PostfixC: EHLO mail.example.orgS: 250-mx.example.netS: 250 STARTTLSC: MAIL FROM:<anna@example.org>S: 250 2.1.0 OkC: RCPT TO:<boris@example.net>S: 250 2.1.5 OkC: DATAS: 354 End data with <CR><LF>.<CR><LF>C: Subject: HelloC: C: Message text.C: .S: 250 2.0.0 Ok: queued as 4F2A1C: QUITS: 221 2.0.0 Bye

Reply codes

CodeMeaningWhat the client should do
2xxsuccess: 250, 221continue
3xxmore data needed: 354 after DATAsend the message body
4xxtemporary error: 421, 450retry later
5xxpermanent error: 550, 554do not retry, report the error

Ports

Port 25 is for transfer between servers (RFC 5321), 587 for message submission by users with STARTTLS (RFC 6409), and 465 for submission with implicit TLS (RFC 8314). The current version of the protocol, RFC 5321 (October 2008), replaced RFC 2821. SMTP only delivers messages to a server: reading a mailbox is done with IMAP and POP3.

Sources

the term is written from these pages

Verified 9 Nov

Not to be confused with

what it is mixed up with and how it differs

In depth in the references

where the topic is covered in detail