An python wrapper for the mailinator.com api
##Installation
Install using pip
pip install py-mailinator
##Commands
Retrieve Inbox Get your api key at the mailinator settings page.
from pymailinator.wrapper import Inbox
inbox = Inbox(api_key)
inbox.get()
print inbox.messages
##Check Mail
mail = inbox.messages[0]
mail.get_message()
print mail.body
##Inbox Object Methods:
get()
: retrieves inboxcount()
: run after get, gets length of inboxview_subjects()
: run after get. Gets lists of subject lines of inboxview_message_ids()
: run after get. Gets lists of subject lines of inboxget_message_by_subject(subject)
: takes a subject as a string, returns message or list of messages with that subjectget_message_by_id(id)
: takes an message id as a string, returns the message if it existsfilter(field, value)
: returns list of message objects where message.field == value
##Message Object Methods:
get_message()
: retrieves full message body and headers
Attributes:
id
: message idsubject
: message subject linetime
: message delivery timeseconds_ago
: number of seconds between time of delivery and time of requestfromshort
: short from fieldfromfull
: full from fieldip
: ip address the email was sent frombeen_read
: boolean if messsage has been openedheaders
: only available afterget_message()
, shows the message headersbody
: only available afterget_message()
, shows message body