Python API wrapper for mailinator

mailinator, api, email
pip install py-mailinator==0.4.6



Build Status PyPI version Code Health Coverage Status

An python wrapper for the api


Install using pip

pip install py-mailinator


Retrieve Inbox Get your api key at the mailinator settings page.

from pymailinator.wrapper import Inbox

inbox = Inbox(api_key)
print inbox.messages

##Check Mail

mail = inbox.messages[0]
print mail.body

##Inbox Object Methods:

  • get() : retrieves inbox
  • count(): run after get, gets length of inbox
  • view_subjects(): run after get. Gets lists of subject lines of inbox
  • view_message_ids(): run after get. Gets lists of subject lines of inbox
  • get_message_by_subject(subject): takes a subject as a string, returns message or list of messages with that subject
  • get_message_by_id(id): takes an message id as a string, returns the message if it exists
  • filter(field, value): returns list of message objects where message.field == value

##Message Object Methods:

  • get_message(): retrieves full message body and headers


  • id : message id
  • subject : message subject line
  • time : message delivery time
  • seconds_ago : number of seconds between time of delivery and time of request
  • origfrom : Original from field
  • ip : ip address the email was sent from
  • been_read : boolean if messsage has been opened
  • headers : only available after get_message(), shows the message headers
  • body : only available after get_message(), shows message body