The smtplib module defines an SMTP client session object that can be used to send mail to any Internet machine with an SMTP or ESMTP listener daemon. For details of SMTP and ESMTP operation, consult RFC 821 (Simple Mail Transfer Protocol) and RFC 1869 (SMTP Service Extensions).
For normal use, you should only require the initialization/connect, sendmail(), and quit() methods. An example is included below.
A nice selection of exceptions is defined as well:
See Also:
Internet RFC 821, Simple Mail Transfer Protocol. Available online at http://info.internet.isi.edu/in-notes/rfc/files/rfc821.txt.
Internet RFC 1869, SMTP Service Extensions. Available online at http://info.internet.isi.edu/in-notes/rfc/files/rfc1869.txt.