Python and sending emails with it

William Park parkw at better.net
Sun Nov 14 13:18:33 CET 1999


On Sat, Nov 13, 1999 at 10:34:10PM -0500, Jeremy Misavage wrote:
> I'm kinda new to python and I'm trying to write a small program that will take
> in form data, save it in a db, and then send an email to a person.
> 
> The program processes a users request for a "equipment request."  It gets
> loggged in a db (already done) and sends an email to the person in change of the
> equipment.  I need help on the email part.  Does some out there have some code
> that will taken data and send it to a person.  It shouldn't need a username and
> password, but if it does I'll live with that.

In Python, try 'smtplib' module.  I think it goes something like
    e = smtplib.SMTP('machine.com')
    e.sendmail('tekhir', 'supervisor', "...")
    e.quit()
Or, if you use Linux machine (like me), pipe the message to 
    mail -s "subject" supervisor

	Yours truly,
	William Park




More information about the Python-list mailing list