Skip to main content

(Below in Russian)

OneSecMail - Create a one-time mail to receive the message

Get a list of available domains

from onesecmail import get_domain_list

domains = get_domain_list()  # Returns a list of available domains
print(domains)

Returns:

  • List of available domains

Get a list of email addresses

from onesecmail import get_random_mail

domains = get_random_mail(count=1)  # Returns a list of random emails
print(domains)

Accepts:

  • The number of addresses to be created (by default 1)

Returns:

  • List of e-mail addresses

Create a mail

from onesecmail import Mail

email = Mail(mail='name@domein.com')
print(email)  # Displays the created mail

Accepts:

  • Email address or name (created automatically by default)

Returns:

  • Mail Object

Get a list of emails in the e-mail

from onesecmail import Mail

email = Mail()
email.check()

Returns:

  • List of dictionaries, each dictionary - information about the letter:
{
    'id': 123454321,               # email id
    'from': 'name@domein.com',     # sender's email
    'subject': 'theme',            # Subject of the letter
    'date': '2021-10-19 17:25:38'  # Date of receipt
}

Receive an e-mail

from onesecmail import Mail

email = Mail()
letter = email.get_letter(let_id=123454321)

Accepts:

  • id of the required email

Returns:

  • Dictionary with all the information about the letter and the files attached to the letter
{
    'id': 123454321,                # email id
    'from': 'name@domein.com',      # sender's email
    'subject': 'theme',             # Subject of the letter
    'date': '2021-10-19 17:25:38',  # Date of receipt
    'attachments':                  # List of files attached to the letter
        [
            {
                'filename': 'image.png',     # File name
                'contentType': 'image/png',  # File Type
                'size': 2048                 # File size in kilobytes
            }
        ]
    'body': '<p>Тело письма</p>',     # Message body (html if exists, text otherwise)
    'textBody': 'Тело письма'         # Message body (text)
    'htmlBody': '<p>Тело письма</p>'  # Message body (html)
}

Get the files attached to the email

from onesecmail import Mail

email = Mail()
attachment = email.get_attachment(let_id=123454321, file='image.png')

Accepts:

  • E-mail id
  • The name of the desired file

Returns:

  • The contents of the file attached to the letter (bytes)

Download the attached file

from onesecmail import Mail

email = Mail()
email.download_attachment(let_id=123454321, file='image.png', path='C:/', new_name='img.png')

Accepts:

  • E-mail id
  • The name of the desired file
  • The path to the folder where you want to download the file
  • If necessary, a new file name (by default swings with the old name)

(Can't create folders, specify the path to an existing folder)

Downloads the file to the specified folder


OneSecMail - Создайте одноразовую почту

Получите список доступных доменов

from onesecmail import get_domain_list

domains = get_domain_list()  # Вернет список доступных доменов
print(domains)

Возвращает:

  • Список доступных доменов

Получите список почтовых адресов

from onesecmail import get_random_mail

domains = get_random_mail(count=1)  # Вернет список случайных почт
print(domains)

Принимает:

  • Количество создаваемых адресов (по умолчанию 1)

Возвращает:

  • Список e-mail адресов

Создайте почту

from onesecmail import Mail

email = Mail(mail='name@domein.com')
print(email) # Выведет созданную почту

Принимает:

  • Адрес почты или название (по умолчанию создается автоматически)

Возвращает:

  • Объект почты

Получите список писем на почте

from onesecmail import Mail

email = Mail()
email.check()

Возвращает:

  • Список словарей, каждый словарь - информация о письме:
{
    'id': 123454321,               # id письма
    'from': 'name@domein.com',     # email отправителя
    'subject': 'theme',            # Тема письма
    'date': '2021-10-19 17:25:38'  # Дата получения
}

Получите письмо

from onesecmail import Mail

email = Mail()
letter = email.get_letter(let_id=123454321)

Принимает:

  • id нужного письма

Возвращает:

  • Словарь со всей информацией о письме и файлах приложенных к письму
{
    'id': 123454321,                # id письма
    'from': 'name@domein.com',      # email отправителя
    'subject': 'theme',             # Тема письма
    'date': '2021-10-19 17:25:38',  # Дата получения
    'attachments':                  # Список файлов приложенных к письму
        [
            {
                'filename': 'image.png',     # Название файла
                'contentType': 'image/png',  # Тип файла
                'size': 2048                 # Размер файла в килобайтах
            }
        ]
    'body': '<p>Тело письма</p>',     # Тело сообщения (html, если существует, текст в противном случае)
    'textBody': 'Тело письма'         # Тело сообщения (текст)
    'htmlBody': '<p>Тело письма</p>'  # Тело сообщения (html)
}

Получите файлы приложенные к письму

from onesecmail import Mail

email = Mail()
attachment = email.get_attachment(let_id=123454321, file='image.png')

Принимает:

  • id письма
  • Название нужного файла

Возвращает:

  • Содержание приложенного к письму файла (байты)

Скачайте приложенный файл

from onesecmail import Mail

email = Mail()
email.download_attachment(let_id=123454321, file='image.png', path='C:/', new_name='img.png')

Принимает:

  • id письма
  • Название нужного файла
  • Путь к папке, куда надо скачать файл
  • Если надо, новое название файла (по умолчанию скачается со старым названием)

(Не может создавать папки, указывайте путь к существующей папке)

Скачивает файл в указанную папку

Metadata

Release files for one-sec-mail 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for one-sec-mail 1.0
File Size Uploaded Provenance Actions
one_sec_mail-1.0.tar.gz 5.2 kB Without provenance Details for one_sec_mail-1.0.tar.gz

Release files / one_sec_mail-1.0.tar.gz

Download URL one_sec_mail-1.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b6d102db39fd63d63e831f5c6b9317e7a093218e340e33522e1f46f6f507eecf
BLAKE2b-256 checksum
How to use checksums
435cb0ca2a0ae4476c10c9ea823268cb28b810c66d31c9cda8cd6b269237da84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Security for one-sec-mail 1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page