Rev. | 176b8405c3554d5eda9aa9ef4f8211ce39eb100b |
---|---|
サイズ | 507 バイト |
日時 | 2008-10-27 20:11:18 |
作者 | iselllo |
ログメッセージ | Python script allowing simple email sending using libgmail (hence it works only for gmail). |
import libgmail
from getpass import getpass
account = raw_input("Enter your account name: ")
password = getpass("Password: ")
to = raw_input("Enter the address to send mail to: ")
subject = raw_input("Enter a subject: ")
message = raw_input("Enter the message: ")
account = libgmail.GmailAccount(account, password)
account.login()
gmessage = libgmail.GmailComposedMessage(to, subject, message)
if account.sendMessage(gmessage):
print "Message sent successfully"
else:
print "Error sending message"