Skip to main content

imap wrapper for me.

Project description

About this module

imap wrapper for me.

Example to use

connect function helps me:

>>> import easyimap
>>> host = "imap.gmail.com"
>>> user = "me@example.com"
>>> password = "hogehogehogehoge"
>>> mailbox = "secret"
>>> mailer = easyimap.connect(host, user, password, mailbox)

I can list up latest n mail by listup method:

>>> mailer.listup(2)
[(80, <easyimap.easyimap.MailObj object at 0x...>), (79, <easyimap.easyimap.MailObj object at 0x...)]
>>> [(id1, mail1), (id2, mail2)] = mailer.listup(2)
>>> id1
80
>>> mail1
<easyimap.easyimap.MailObj object at 0x...>
>>> type(mail1.body)
<type 'unicode'>
>>> type(mail1.title)
<type 'unicode'>
>>> type(mail1.date)
<type 'unicode'>
>>> type(mail1.sender)
<type 'unicode'>

And I can directly grub mail body by index:

>>> body = mailer.body(80)
>>> type(body)
<type 'unicode'>

Finally, quit method helps me:

>>> mailer.quit()

Basic API

  • easyimap.connect(host, user, password, mailbox)

    Create nice object.

MailerFacade

  • listup(limit=10)

    Returns list of tuples(email_id, mail_object).

  • body(id)

    Returns string of email body.

  • quit

    Close and logout.

MailObject

  • title

    Returns string of ‘Subject’ header.

  • sender

    Returns string of ‘From’ header.

  • date

    Returns string of ‘Date’ header.

  • body

    Returns string of Body.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

easyimap-0.1.1.zip (6.7 kB view hashes)

Uploaded Source

easyimap-0.1.1.tar.gz (3.9 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page