What happens between pressing send and the message arriving?
SMTP can carry a message across several networks, which RFC 5321 calls relaying: a message may pass through a number of intermediate relay or gateway hosts on its path from sender to final recipient [1].
- Your mail program submits the message Your app or website form passes the message to an outgoing server. RFC 5321 says a separate mail submission protocol is preferred to direct use of SMTP for this first step [1]. The one it names, RFC 4409, has since been obsoleted by RFC 6409 [4].
- The server looks up the recipient's domain Usually the next hop is found through the recipient domain's MX record, not by an explicit route written into the message [1].
- The server connects and hands over the message The server connects to the host the MX record names. The specification discusses transport over TCP [1].
- The receiving server accepts it A receiving SMTP server is expected to keep a pending listen on port 25 at all times [1].
How does SMTP know where to send mail for my domain?
An MX record in DNS points a domain at a host that will act as its mail exchange [2]. RFC 5321 adds a fallback: if the lookup returns an empty list of MX records, the address is treated as if it had an implicit MX record with a preference of 0, pointing to that host [1]. If MX records exist but none can be used, the sender must report an error [1].
; Where a sending server delivers mail for yourshop.sg
yourshop.sg. 3600 IN MX 10 mail.hostco.example.
So a wrong or missing MX record stops incoming mail even when your mailboxes are fine. How to write one is covered under MX record.
Which port should my SMTP server use?
RFC 5321 names port 25 as the SMTP port that IANA specified, and says a receiving server should keep a listener there [1]. RFC 6409 then separates two jobs: message relay between servers continues to use SMTP over port 25, while message submission from a mail program normally uses port 587 [4]. It adds that many sites prohibit outbound traffic on port 25 and funnel all mail submissions through submission servers [4]. For the host name and login your app needs, use the setup page of your mail provider.
Does SMTP check that the sender is who they claim to be?
Not by itself. RFC 5321 says SMTP mail is inherently insecure, because even casual users can talk directly to mail servers and create messages that trick a naive recipient into believing they came from somewhere else [1]. Sender checks are added on top: Google says to set up SPF or DKIM authentication for your sending domains and to use a TLS connection for transmitting email [3]. See SPF record, DKIM and DMARC, and email deliverability for the rules Gmail applies to the mail you send.
A contact form that sends no email
Say your shop's website form is set to send mail straight from the web server, and the messages never arrive. Check three things in order: the form's outgoing settings point to your SMTP server, the sending domain has SPF or DKIM, and the MX record of the address you are sending to is correct.
Questions people ask
What does SMTP stand for?
Simple Mail Transfer Protocol. RFC 5321 says its objective is to transfer mail reliably and efficiently, and that it is the Internet protocol for moving mail between servers [1].
Is SMTP the same as an MX record?
No. SMTP is the protocol servers speak to move a message [1]. The MX record is the DNS entry a sending server reads to find which host to speak to for a domain [1][2].
Can SMTP read my inbox?
No. RFC 5321 describes SMTP as a mail transport and delivery protocol. Mail programs read mail from a mailbox with other protocols, such as POP and IMAP, which the RFC names [1].
Pages that link here
See also
- MX record An MX record is a DNS entry that names the mail server that receives email sent to your domain.
- DNS DNS is the internet's address book: it turns a domain name like example.com into the number a computer needs to find your website or mail server.
- Email deliverability Email deliverability is whether the email you send actually reaches the recipient's inbox instead of being blocked or sent to spam.
- SPF record An SPF record is a line of text in your domain's DNS that lists which mail servers are allowed to send email using your domain name.
- DKIM DKIM is an email check where your mail server signs each message and publishes a public key in DNS, so the receiver can confirm the signature.
- TLS TLS is the security protocol that encrypts the connection between a browser and a website, and it is what makes HTTPS secure.
References
- RFC 5321: Simple Mail Transfer Protocol, IETF. Read 27/11/2026.
The objective of the Simple Mail Transfer Protocol (SMTP) is to transfer mail reliably and efficiently.
- RFC 1035: Domain Names, Implementation and Specification, IETF. Read 27/11/2026.
EXCHANGE A <domain-name> which specifies a host willing to act as a mail exchange for the owner name.
- Email sender guidelines, Gmail Help. Read 27/11/2026.
Use a TLS connection for transmitting email.
- RFC 6409: Message Submission for Mail, IETF. Read 27/11/2026.
When conforming to this document, message submission uses the protocol specified here, normally over port 587.