Skip to content

    What is SMTP?

    SMTP, or Simple Mail Transfer Protocol, is the protocol that moves email from the sender's program to its server and from one server to the next until the message reaches its destination. It is defined in RFC 5321 and is used only to send and relay mail, not to read it.

    Key points

    • Port 25 carries mail between servers; ports 587 and 465 are for users submitting mail with authentication.
    • A session follows the sequence EHLO, MAIL FROM, RCPT TO, DATA and QUIT.
    • Replies starting with 2 mean success, 4 means try again later and 5 means permanent failure.
    • The envelope addresses in MAIL FROM and RCPT TO can differ from the From and To headers.
    • Reading the mailbox is done with IMAP or POP3, not with SMTP.

    How does an SMTP session work?

    The client connects and the server greets it with code 220. The client introduces itself with EHLO and the server lists its extensions, such as STARTTLS and AUTH. The client then sends MAIL FROM with the envelope sender, one RCPT TO per recipient and DATA followed by the message, which ends with a line containing only a dot.

    The server accepts with 250 and queues the message. If it cannot accept, a 4xx code tells the sender to retry later and a 5xx code tells it to give up and return a bounce.

    What is the difference between the SMTP ports?

    Port 25 is for delivery between servers and is often blocked on residential connections. Port 587 is the submission port, where the user authenticates and usually upgrades with STARTTLS. Port 465 is submission with implicit TLS, recommended by RFC 8314.

    Why is SMTP abused by spammers?

    The original protocol trusted the sender's word. Anyone could claim any address in MAIL FROM, and open relays forwarded mail for anyone. Authentication on submission, SPF, DKIM and DMARC were added over the years to close those gaps.

    Example SMTP session

    S: 220 mx.example.com ESMTP
    C: EHLO mail.example.com
    S: 250-mx.example.com
    S: 250 SIZE 52428800
    C: MAIL FROM:<[email protected]>
    S: 250 2.1.0 Ok
    C: RCPT TO:<[email protected]>
    S: 250 2.1.5 Ok
    C: DATA
    S: 354 End data with <CR><LF>.<CR><LF>
    C: Subject: Test
    C:
    C: Hello.
    C: .
    S: 250 2.0.0 Ok: queued
    C: QUIT
    S: 221 2.0.0 Bye

    How AHSU 360 handles this

    AHSU 360 receives the SMTP traffic of the domain before the mail server and filters spam and viruses in layers. For outgoing mail, the partner server sends through the UNODATA relay, which applies a limit per account and signs with DKIM.

    Questions and answers

    Is SMTP encrypted?
    Not by default. Encryption comes from TLS, either through STARTTLS or through implicit TLS on port 465. Between servers it is usually opportunistic unless MTA-STS is in place.
    What does a 550 error mean?
    It is a permanent failure. The receiving server refused the message, often because the mailbox does not exist or the sender failed a policy check, and the sender should not retry.

    Related terms

    Reviewed 22/11/2026 · Email and email security for businesses since 2001.