Skip to content
/ langusta Public

Simple package for retrieving emails. Higher abstraction level built on top of Python standard library.

License

Notifications You must be signed in to change notification settings

fwkz/langusta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Langusta

Simple package for retrieving emails from IMAP servers. Higher abstraction level built on top of Python standard library. Langusta introduce extended Email object for easier email parsing.

Getting started

Retrieve latest email from GMail mailbox.

import langusta


SECRET_PASSWORD = "!@#$%^"
SECRET_LOGIN = "your_login"

mailbox = langusta.Mailbox(server="imap.gmail.com",
                           login=SECRET_LOGIN,
                           password=SECRET_PASSWORD)

latest_message_id = mailbox.get_message_list()[-1]

email = mailbox.get_message(latest_message_id)


print "From: {0}\nTo: {1}\nSubject: {2}\nDate: {3}\n\n {4}".format(email.sender().address, 
                                                                   email.recipient().address,
                                                                   email.date(),
                                                                   email.content())

License

MIT

About

Simple package for retrieving emails. Higher abstraction level built on top of Python standard library.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages