SMTP is the protocol used to send email between mail servers.
SMTP stands for Simple Mail Transfer Protocol and operates at the application layer of the Internet protocol suite. When a message leaves the sender’s mail server, SMTP handles its transfer to the recipient’s mail server, often through one or more intermediary relays.
Mail servers use DNS to find the recipient domain’s mail exchanger, or MX, record. The sending server then opens an SMTP connection and exchanges commands such as MAIL, RCPT, and DATA. SMTP is primarily a delivery and submission protocol; it does not normally retrieve messages from a mailbox.
That distinction causes a frequent mix-up. IMAP and POP3 are used by email clients to retrieve stored messages, while SMTP sends outgoing mail. Server-to-server SMTP commonly uses TCP port 25. Authenticated client submission generally uses port 587, while port 465 is also used for SMTP submission with implicit TLS.