[Tutor] Sending Email

Kent Johnson kent37 at tds.net
Wed Oct 3 23:02:52 CEST 2007

Steve Willoughby wrote:

> Python comes with an smtplib module which works very well.  You say 
> you want plain text, so just do this:
> import smtplib
> mail = smtplib.SMTP(mailhost_name)
> mail.sendmail(from_addr, to_addr, msg)
> mail.quit()

One gotcha is that msg must also include From and Two headers. A 
slightly longer example is here:


More information about the Tutor mailing list