Skip to main content

Asynchronously send emails via SMTP

Project description

BMailer

image image image Actions status codecov

BMailer is an asynchronous email sender built with Python, designed to send bulk emails efficiently using SMTP. It supports templating for email bodies and allows for concurrent sending of multiple emails.

Example Usage

import asyncio

from bmailer import AsyncMailer
from bmailer.models import EmailPayload
from bmailer.templates import render_template


async def main():
    sender = AsyncMailer(
        host="smtp.gmail.com",
        port=587,
        username="email@email.com",
        password="app_password", # If using Gmail, use an App Password
    )

    template = "Hello {name},\nYour order #{order_id} has been shipped."
    emails = [
        EmailPayload(
            subject="Order Update",
            recipient="target@email.com",
            body=render_template(template, name="Recipient", order_id=123),
        ),
    ]

    await sender.send_bulk(emails, concurrency=5)


if __name__ == "__main__":
    asyncio.run(main())

Installation

pip install bmailer

Contribution

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

git clone https://github.com/duytanisme/bmailer.git
cd bmailer
uv sync

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

bmailer-0.1.1.tar.gz (28.1 kB view details)

Uploaded Source

Built Distribution

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

bmailer-0.1.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file bmailer-0.1.1.tar.gz.

File metadata

  • Download URL: bmailer-0.1.1.tar.gz
  • Upload date:
  • Size: 28.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for bmailer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e6a0b13437a002b22d245ee073ec1120ac1be047ae0a964fee82cab6f276e428
MD5 727e0a4cb33f16087352370aa0694396
BLAKE2b-256 5e02da32bef9f4642800083800124a260ed3dea272f75ad94255c693c811c6b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for bmailer-0.1.1.tar.gz:

Publisher: test-and-release.yaml on duytanisme/bmailer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bmailer-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: bmailer-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for bmailer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b87ca8d6c5954a9a8c66efa06a8bd515986934dfeca26c1e7c346c8f4c85f02e
MD5 f46b6a7af744d2821107d106fe7ce74b
BLAKE2b-256 e3e1d321eecfd1eee9352b371faaeaebcc02071133fb03d460c5cc9d27ea2503

See more details on using hashes here.

Provenance

The following attestation bundles were made for bmailer-0.1.1-py3-none-any.whl:

Publisher: test-and-release.yaml on duytanisme/bmailer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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