Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

cododel/MailTm

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MailTM API Wrapper

MailTm is a free temporary mail service, This fork of library, thats is useful for automation tasks such as making accounts that needs email verification. New in fork:

  • Pydantic models for messages and credentials on register
  • Waiting for mew message
  • Return credentials for new registered account
  • Login method

Installation

Windows:

pip install mailtmpy

Linux/Mac OS:

pip3 install mailtmpy

Example

from mailtmpy import Email

def listener(message):
    print("\nSubject: " + message['subject'])
    print("Content: " + message['text'] if message['text'] else message['html'])

# Get Domains
test = Email()
print("\nDomain: " + test.domain)

# Make new email address
test.register()
print("\nEmail Adress: " + str(test.address))

# Start listening
test.start(listener)
print("\nWaiting for new emails...")

# Wait for new message
new_message = test.wait_for_new_message()
print("New message:", new_message)

Documentation

API: https://mail.tm

register(username=None, password=None, domain=None) | Make an email account with random credentials, You can also pass a username, password and domain to use the same account.

start(listener, interval=3) | Start listening for new emails, Interval means how many seconds takes to sync, And you also need to pass a function for listener, This function gets called when new email arrive.

stop() | Stop listening for new emails.

About

MailTm - Temporary Email

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.