Any easy-to-use email send module?

oyster lepto.python at gmail.com
Wed Dec 20 03:35:58 EST 2006


I find that the existing email moudle is some hard for me to
understand, especially the part of how to set the CC, BCC and attach
the files. Is there any more easy one like this p-code?

import easyemail
smtpserver=easyemail.server('something')
smtpserver.login('usr at gmail.com', pwd)
newletter=smtpsever.letter(smtpserver)
newletter.sendto=['to1 at 1.com', 'to2 at 2.com']
newletter.sendcc=['cc1 at 111.com', 'cc2 at 222.com']
newletter.sendbcc=['bcc1 at 111.com', 'bcc2 at 222.com']
newletter.body='this is the body\nline 2'
newletter.att=['c:/file1.txt', 'd:/program files/app/app.exe']

if (newletter.send()==True):
    print 'send ok'
smtpserver.close()

Thanx.



More information about the Python-list mailing list