I recommend the example in the Python Library Reference as a better example:
http://www.python.org/doc/lib/SMTP-example.html. You can also find the
entire description of the smtplib module in the same section
(http://www.python.org/doc/lib/module-smtplib.html).
Xah Lee's example is missing:
- The login() call needed by SMTP hosts that require authentication.
- The 'From:' and 'To:' addresses in the header of the email. They
are not mandatory, but you would probably use them.
--
http://mail.python.org/mailman/listinfo/python-list