• R/O
  • SSH

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

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

Commit MetaInfo

Revision176b8405c3554d5eda9aa9ef4f8211ce39eb100b (tree)
Zeit2008-10-27 20:11:18
Autoriselllo
Commiteriselllo

Log Message

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

Ändern Zusammenfassung

Diff

diff -r 7bacdc10d9af -r 176b8405c355 Python-codes/sendmail_libgmail.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Python-codes/sendmail_libgmail.py Mon Oct 27 11:11:18 2008 +0000
@@ -0,0 +1,19 @@
1+import libgmail
2+from getpass import getpass
3+
4+account = raw_input("Enter your account name: ")
5+password = getpass("Password: ")
6+to = raw_input("Enter the address to send mail to: ")
7+subject = raw_input("Enter a subject: ")
8+message = raw_input("Enter the message: ")
9+
10+account = libgmail.GmailAccount(account, password)
11+
12+account.login()
13+gmessage = libgmail.GmailComposedMessage(to, subject, message)
14+
15+if account.sendMessage(gmessage):
16+ print "Message sent successfully"
17+else:
18+ print "Error sending message"
19+