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
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 ByeReply codes
| Code | Meaning | What the client should do |
|---|---|---|
| 2xx | success: 250, 221 | continue |
| 3xx | more data needed: 354 after DATA | send the message body |
| 4xx | temporary error: 421, 450 | retry later |
| 5xx | permanent error: 550, 554 | do 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- RFC 5321 — Simple Mail Transfer Protocolrfc-editor.org/rfc/rfc5321(opens in a new tab)
- RFC 6409 — Message Submission for Mailrfc-editor.org/rfc/rfc6409(opens in a new tab)
- RFC 8314 — Cleartext Considered Obsolete: Use of TLS for Email Submission and Accessrfc-editor.org/rfc/rfc8314(opens in a new tab)
Verified 9 Nov