Skip to content

DedInc/freetempmail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

freetempmail - Temp-Mail.org API wrapper.

How to Use?

Quickstart Guide

import asyncio
from freetempmail import FreeTempMail

if __name__ == '__main__':
    ftm = FreeTempMail()  # Instantiate class
    asyncio.run(ftm.generate_mail())  # Generate a temporary mail
    email = ftm.get_email()  # Fetch email info
    print(email)

    messages = ftm.get_messages()  # Fetch messages in mailbox
    print(messages)

    message_id = messages[0]['_id']  # Fetch a specific message by ID
    message_content = ftm.get_message(message_id)
    print(message_content)

Receive and Process a New Message

import asyncio
from freetempmail import FreeTempMail

if __name__ == '__main__':
    ftm = FreeTempMail()  # Instantiate class
    asyncio.run(ftm.generate_mail())  # Generate a temporary mail
    email = ftm.get_email()  # Fetch email info
    print(email)

    new_message = ftm.wait_message()  # Wait and fetch a new message
    print(new_message)