An open API service indexing awesome lists of open source software.

https://github.com/dedinc/freetempmail

Temp-Mail.org API wrapper.
https://github.com/dedinc/freetempmail

api api-wrapper python python-3 python-module temp-mail temp-mail-api tempmailorg

Last synced: 7 months ago
JSON representation

Temp-Mail.org API wrapper.

Awesome Lists containing this project

README

          

freetempmail - Temp-Mail.org API wrapper.

How to Use?

Quickstart Guide

```python
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

```python
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)
```