• R/O
  • SSH

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

File Info

Rev. 176b8405c3554d5eda9aa9ef4f8211ce39eb100b
Size 507 bytes
Time 2008-10-27 20:11:18
Author iselllo
Log Message

Python script allowing simple email sending using libgmail (hence it works only for gmail).

Content

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"