from smtplib import SMTP from socket import sslerror #if desired server = SMTP('smtp.gmail.com') server.set_debuglevel(0) # or 1 for verbosity server.ehlo('[EMAIL PROTECTED]') server.starttls() server.ehlo('[EMAIL PROTECTED]') # say hello again server.login('[EMAIL PROTECTED]', 'yourpassword') # i have a suspicion that smptlib does not add the required newline dot newline so i do it myself server.sendmail('[EMAIL PROTECTED]', '[EMAIL PROTECTED]', message_text + '\n.\n') # next line generates the ignorable socket.sslerror server.quit()
-- http://mail.python.org/mailman/listinfo/python-list