Merged changes from the 1.5.2p2 release.
(Very rough.)
diff --git a/Doc/lib/libsmtplib.tex b/Doc/lib/libsmtplib.tex
index d366cca..445a417 100644
--- a/Doc/lib/libsmtplib.tex
+++ b/Doc/lib/libsmtplib.tex
@@ -74,6 +74,17 @@
 \end{excdesc}
 
 
+\begin{seealso}
+  \seetext{Internet \rfc{821}, \emph{Simple Mail Transfer Protocol}.
+           Available online at
+           \url{http://info.internet.isi.edu/in-notes/rfc/files/rfc821.txt}.}
+
+  \seetext{Internet \rfc{1869}, \emph{SMTP Service Extensions}.
+           Available online at
+           \url{http://info.internet.isi.edu/in-notes/rfc/files/rfc1869.txt}.}
+\end{seealso}
+
+
 \subsection{SMTP Objects \label{SMTP-objects}}
 
 An \class{SMTP} instance has the following methods:
@@ -160,6 +171,10 @@
 to use the low-level methods such as \method{mail}, \method{rcpt} and
 \method{data} to send the message.)
 
+\strong{Note:}  The \var{from_addr} and \var{to_addrs} parameters are
+used to construct the message envelope used by the transport agents.
+The \class{SMTP} does not modify the message headers in any way.
+
 If there has been no previous \samp{EHLO} or \samp{HELO} command this
 session, this method tries ESMTP \samp{EHLO} first. If the server does
 ESMTP, message size and each of the specified options will be passed
@@ -177,27 +192,25 @@
 
 This method may raise the following exceptions:
 
-\begin{itemize}
+\begin{description}
 \item[\exception{SMTPRecipientsRefused}]
 All recipients were refused.  Nobody got the mail.  The
-\var{recipients} attribute of the exception object is a dictionary
+\member{recipients} attribute of the exception object is a dictionary
 with information about the refused recipients (like the one returned
 when at least one recipient was accepted).
 
 \item[\exception{SMTPHeloError}]
-The server didn't reply properly to
-the helo greeting.
+The server didn't reply properly to the \samp{HELO} greeting.
 
 \item[\exception{SMTPSenderRefused}]
-The server didn't accept the from_addr.
+The server didn't accept the \var{from_addr}.
 
 \item[\exception{SMTPDataError}]
-The server replied with an unexpected
-error code (other than a refusal of
-a recipient).
-\end{itemize}
+The server replied with an unexpected error code (other than a refusal
+of a recipient).
+\end{description}
 
-Unless otherwise noted the connection will be open even after
+Unless otherwise noted, the connection will be open even after
 an exception is raised.
 
 \end{methoddesc}
@@ -216,33 +229,37 @@
 \subsection{SMTP Example \label{SMTP-example}}
 
 This example prompts the user for addresses needed in the message
-envelop (`To' and `From' addresses), and the message to be
+envelope (`To' and `From' addresses), and the message to be
 delivered.  Note that the headers to be included with the message must 
 be included in the message as entered; this example doesn't do any
 processing of the \rfc{822} headers.  In particular, the `To' and
 `From' addresses must be included in the message headers explicitly.
 
 \begin{verbatim}
-import rfc822, string, sys
 import smtplib
+import string
 
 def prompt(prompt):
-    sys.stdout.write(prompt + ": ")
-    return string.strip(sys.stdin.readline())
+    return string.strip(raw_input(prompt))
 
-fromaddr = prompt("From")
-toaddrs  = string.splitfields(prompt("To"), ',')
+fromaddr = prompt("From: ")
+toaddrs  = string.split(prompt("To: "))
 print "Enter message, end with ^D:"
-msg = ""
+
+# Add the From: and To: headers at the start!
+msg = ("From: %s\r\nTo: %s\r\n\r\n"
+       % (fromaddr, string.join(toaddrs, ", ")))
 while 1:
-    line = sys.stdin.readline()
+    line = raw_input()
     if not line:
         break
     msg = msg + line
+
 print "Message length is " + `len(msg)`
 
 server = smtplib.SMTP('localhost')
 server.set_debuglevel(1)
+server.connect()
 server.sendmail(fromaddr, toaddrs, msg)
 server.quit()
 \end{verbatim}