Using smtplib

David Boddie davidb at dcs.st-and.ac.uk
Fri Mar 10 18:12:20 CET 2000


On Fri, 10 Mar 2000, Pieter Claerhout wrote:

> does anyone has an example on how to send an email using the
> smtplib? I'm able to send an email, but I can't figure out how to
> fill in the from, subject and to fields.

The documentation for this module contains an example:

http://www.python.org/doc/current/lib/SMTP-example.html

When reading e-mail which was sent by this example, only the "From:" and
"Date:" headers seem to be generated. As far as I can tell, if you want
"To:" and "Subject:" headers to appear in the e-mail then you have to
include them in the message body. The manual suggests that you also
include the "From:" header as well.

Hope this helps,

David
-- 
David Boddie
Solar MHD Theory Group, St Andrews
http://www-solar.mcs.st-and.ac.uk/~davidb/index.html







More information about the Python-list mailing list