Coder Social home page Coder Social logo

matthieuev / mail-generator Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 47 KB

A Python package that provides an easy-to-use interface for creating and managing email addresses

Home Page: https://pypi.org/project/mail-Generator/

License: GNU General Public License v3.0

Python 100.00%

mail-generator's Introduction

Logo

Mail-generator

GitHub Workflow Status (with event) Static Badge

Description

Mail-Generator is a Python package that provides an easy-to-use interface for creating and managing email addresses using the MailSlurp API. With Mail-Generator, you can quickly create new email addresses, read emails from an inbox, and more.

Installation

pip install mail-generator

Usage

# Import the MailGenerator class
from mail_generator import MailGenerator
# Create a MailGenerator object with your MailSlurp API key
client = MailGenerator(<api_key>)

You can find your MailSlurp API key here.

Features

Create an email address

email_id = client.create_email() #  Returns the ID of the email address created.
print(email_id + "@mailslurp.com")

Get emails from an inbox

emails = client.get_email_data(email_id) # Returns a list of emails in the inbox.

Example:

[
    {
        'id': 'adde245b-fa00-48cd-8a31-77f42737006e',
        'domain_id': None,
        'subject': 'Test',
        'to': ['[email protected]'],
        '_from': '[email protected]',
        'bcc': [],
        'cc': [],
        'created_at': datetime.datetime(2023, 7, 13, 11, 28, 7, tzinfo=tzutc()),
        'read': True,
        'attachments': [],
        'body': '<div dir="ltr">Hello World<br></div>\r\n'
    }, 
    {
        'id': 'ede7bb4f-8a47-4631-9ca1-78389a55cced',
        'domain_id': None,
        'subject': 'Hi there',
        'to': ['[email protected]'],
        '_from': '[email protected]',
        'bcc': [],
        'cc': [],
        'created_at': datetime.datetime(2023, 7, 13, 11, 29, 33, 473000, tzinfo=tzutc()),
        'read': True,
        'attachments': ['1689251504-9e7166b2-b96c-44cd-8e2a-95500df5c0ac'],
        'body': '<div dir="ltr">This is also a hello world<br></div>\r\n'
    }
]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.