Skip to main content

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

Project description

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': ['example@mailslurp.com'],
        '_from': 'example@email.com',
        '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': ['example@mailslurp.com'],
        '_from': 'example@email.com',
        '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'
    }
]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mail-Generator-0.2.2.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mail_Generator-0.2.2-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file mail-Generator-0.2.2.tar.gz.

File metadata

  • Download URL: mail-Generator-0.2.2.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for mail-Generator-0.2.2.tar.gz
Algorithm Hash digest
SHA256 203022a90c8c64f4d3d4ab605f0f2069b1fd6920804fd7267178ecccf9969fad
MD5 7bac6eab11e4b6ac5e3d5b900beff646
BLAKE2b-256 4139c501984b039ed222343354c5bbf13ee2b613c138fc60f7c5a5f88449f9d6

See more details on using hashes here.

File details

Details for the file mail_Generator-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: mail_Generator-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for mail_Generator-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b9ada09c194055071515a325cc21d451eabf50e07f0ddf86f79330c71883f93b
MD5 f8f17110d19b5cecac93f04836343ee3
BLAKE2b-256 a1a994b55090a961590e38fee39dac6839468c7582bc8d6e575a8b6e4ea134dd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page