How it works
SMTP (Simple Mail Transfer Protocol) dates from 1982 and still carries email between servers today. A sending server looks up the recipient domain's MX records in DNS, connects to that mail server on port 25 and hands over the message. Apps and mail programs submit mail to their own provider on port 587 (upgraded to encryption with STARTTLS) or 465 (encrypted from the start), logging in with a username and password.
Every sending service (Resend, SendGrid, Amazon SES, Postmark) offers an SMTP relay, so frameworks, WordPress plugins and older software can send without custom code, and each also offers an HTTP API, which is usually quicker to call and returns clearer errors. Many clouds block outgoing port 25 to fight spam, one more reason apps send through a relay. SMTP only sends mail; reading a mailbox uses IMAP or POP3.