Please Whitelist This Site?

I know everyone hates ads. But please understand that I am providing premium content for free that takes hundreds of hours of time to research and write. I don't want to go to a pay-only model like some sites, but when more and more people block ads, I end up working for free. And I have a family to support, just like you. :)

If you like The TCP/IP Guide, please consider the download version. It's priced very economically and you can read all of it in a convenient format without ads.

If you want to use this site for free, I'd be grateful if you could add the site to the whitelist for Adblock. To do so, just open the Adblock menu and select "Disable on tcpipguide.com". Or go to the Tools menu and select "Adblock Plus Preferences...". Then click "Add Filter..." at the bottom, and add this string: "@@||tcpipguide.com^$document". Then just click OK.

Thanks for your understanding!

Sincerely, Charles Kozierok
Author and Publisher, The TCP/IP Guide


NOTE: Using software to mass-download the site degrades the server and is prohibited.
If you want to read The TCP/IP Guide offline, please consider licensing it. Thank you.

The Book is Here... and Now On Sale!

Read offline with no ads or diagram watermarks!
The TCP/IP Guide

Custom Search







Table Of Contents  The TCP/IP Guide
 9  TCP/IP Application Layer Protocols, Services and Applications (OSI Layers 5, 6 and 7)
      9  TCP/IP Key Applications and Application Protocols
           9  TCP/IP File and Message Transfer Applications and Protocols (FTP, TFTP, Electronic Mail, USENET, HTTP/WWW, Gopher)
                9  TCP/IP Electronic Mail System: Concepts and Protocols (RFC 822, MIME, SMTP, POP3, IMAP)
                     9  TCP/IP Electronic Mail Delivery Protocol: The Simple Mail Transfer Protocol (SMTP)

Previous Topic/Section
SMTP Connection and Session Establishment and Termination
Previous Page
Pages in Current Topic/Section
12
3
Next Page
SMTP Special Features, Capabilities and Extensions
Next Topic/Section

SMTP Mail Transaction Process
(Page 3 of 3)

SMTP Mail Transaction Details

Let’s take a more detailed look at the SMTP mail transaction process, using as aids the process diagram in Figure 305 and the example transaction of Table 250 (which has commands highlighted in bold and replies in italics). The first two steps in the mail transaction are responsible for providing the receiving SMTP server with the envelope information just discussed. The transaction begins by the SMTP sender issuing a MAIL command. This serves to inform the receiver that a new transaction is commencing, and also to tell it the “from” information on the “envelope”. An example:

MAIL FROM:<joe@someplace.org>

Figure 305: SMTP Mail Transaction Process

Once an SMTP session is established between a sender and receiver, each mail transaction consists of a set of three command/reply sequences. The sender is first identified using the MAIL command and the recipients are specified using one or more RCPT commands. The actual mail message is then transferred using the DATA command, which involves a preliminary reply before the actual message is sent, and a completion reply when it has been fully received.

 


The e-mail address of the originator is always enclosed in angle brackets (“<”and “>”). The SMTP receiver acknowledges the command with a 250 (“OK”) reply message, sometimes sending back the address as a confirmation. For example:

250 <joe@someplace.org>… Sender ok

Next, the SMTP sender uses RCPT commands to specify the intended recipients of the e-mail that is being sent. Each RCPT line can contain only one recipient, so if multiple recipients are indicated, two or more RCPT commands must be issued. Each one normally specifies an e-mail address, but if relaying is being used, the command may contain routing information as well. (As described in the SMTP communication topic, this is not as commonly done as it was in the past.) For example:

RCPT TO:<jane@somewhereelse.com>

Assuming the server accepts the e-mail, it will give a 250 “OK” reply again, such as this:

250 <jane@somewhereelse.com>… Recipient ok

The SMTP sender then issues the DATA command, which tells the SMTP receiver that the message is coming:

DATA

The SMTP receiver responds with a 354 “intermediate” reply message, such as this:

354 Enter mail, end with “.” on a line by itself

The SMTP sender then sends the e-mail message, one line at a time, with a single “.” on a line to terminate it. The server confirms the receipt of the message with another 250 “OK” reply, and the transaction is done.


Table 250: Example SMTP Mail Transaction

MAIL FROM:<joe@someplace.org>
250 <joe@someplace.org>… Sender ok
RCPT TO:<jane@somewhereelse.com>
250 <jane@somewhereelse.com>… Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
From: Joe Sender <joe@someplace.org>
To: Jane Receiver <jane@somewhereelse.com>
Date: Sun, 1 Jun 2003 14:17:31 —0800
Subject: Lunch tomorrow

Hey Jane,

It's my turn for lunch tomorrow. I was thinking we could
[rest of message]
Hope you are free. Send me a reply back when you get a chance.
Joe.
.
250 OK


Key Concept: After an SMTP session is established, e-mail messages are sent using the SMTP mail transaction process. The SMTP sender starts the transaction by identifying the sender of the e-mail, and then specifying one or more recipients. The e-mail message itself is then transmitted to the SMTP receiver. Each e-mail to be sent is a separate transaction.


Potential Mail Transaction Complications

While this indeed is quite simple, I should point out that I have only shown an e-mail from a sender to one recipient, and the case where there are no problems or complications in the transaction. Due to either command syntax or server issues, it is possible for various types of errors to occur at different stages of the process, which may result in the transaction failing. There are also security concerns that may come into play, that may lead to restrictions in what transactions a server may allow.


Previous Topic/Section
SMTP Connection and Session Establishment and Termination
Previous Page
Pages in Current Topic/Section
12
3
Next Page
SMTP Special Features, Capabilities and Extensions
Next Topic/Section

If you find The TCP/IP Guide useful, please consider making a small Paypal donation to help the site, using one of the buttons below. You can also donate a custom amount using the far right button (not less than $1 please, or PayPal gets most/all of your money!) In lieu of a larger donation, you may wish to consider purchasing a download license of The TCP/IP Guide. Thanks for your support!
Donate $2
Donate $5
Donate $10
Donate $20
Donate $30
Donate: $



Home - Table Of Contents - Contact Us

The TCP/IP Guide (http://www.TCPIPGuide.com)
Version 3.0 - Version Date: September 20, 2005

© Copyright 2001-2005 Charles M. Kozierok. All Rights Reserved.
Not responsible for any loss resulting from the use of this site.