SMTP - Simple Mail Transport Protocol
SMTP Sequence
NVM Voice Mail Win2K/SMTP Email Integration
23
SMTP
Sequence
SMTP commands are ASCII strings terminated by a CRLF combination. Here is how
a typical SMTP connection works:
The client has responsibility for delivering a message to one or more envelope
recipients, or notifying an envelope sender if delivery is not made. It wants to
transfer this responsibility to the server.
The client waits for the server's greeting:
220 heaven.af.mil ESMTP
If the server does not accept the connection, the client quits.
The client then sends a HELO request, and waits for the response:
HELO sun.af.mil
250 heaven.af.mil
If the server does not accept the request, the client quits.
The client then sends a MAIL request showing the envelope sender address, and
waits for the response:
MAIL FROM:<[email protected]>
250 ok
If the server does not accept the request, the client quits.
The client then sends one RCPT request for each envelope recipient address,
waiting for a response after each address:
RCPT TO:<[email protected]>
250 ok
It keeps track of which addresses are accepted. If none of the addresses are
accepted, the client quits.
The client then sends a DATA request, and waits for the response:
DATA
354 go ahead
If the server does not accept the request, the client quits.
The client then sends the encoded message, waits for the response, and quits:
Date: 8 Aug 1998 04:10:45 -0000
From: [email protected]
Subject: chariot is back in service
I patched up the wheel. It's as good as new.
250 ok 902549473 qp 24035
.
QUIT
221 heaven.af.mil
If the client encounters a message I/O error, it closes the connection immediately,
without sending a final dot and without sending a QUIT request.