Skip to content

FluxMail

FluxMail

Send emails from the terminal or Python — SMTP and Outlook in one library.

Get Started Python API


PyPI Python License Downloads CI


SMTP

Send via any SMTP server — Gmail, SendGrid, SES, Mailgun, or your own relay — with STARTTLS and credential auth.

Outlook

Compose and preview Outlook emails via COM automation. Windows only — no extra configuration required.

CLI

One-line sends from the terminal. All options as flags; credentials safely via environment variables.

Python API

Chainable API: FluxMail(...).create(...).send(). Plugs into any Python script or automation pipeline.


Quickstart

Python
from fluxmail import FluxMail

FluxMail(
    object_type="smtp",
    host="smtp.gmail.com",
    port=587,
    use_tls=True,
    username="me@gmail.com",
    password="secret",
).create(
    subject="Hello",
    recipients=["friend@example.com"],
    body="Hi there!",
).send()
Bash
pip install fluxmail

FLUXMAIL_USERNAME=me@gmail.com FLUXMAIL_PASSWORD=secret \
  fluxmail --type smtp --host smtp.gmail.com --port 587 --tls \
    --subject "Hello" \
    --recipients friend@example.com \
    --body "Hi there!"

What's included

  • Secure credential handling — load SMTP credentials from env vars; passwords never appear in shell history

  • File attachments — attach any file; MIME type is detected automatically

  • HTML or plain text — switch body format with a single flag or parameter

  • Dry-run preview — inspect the full email before it leaves your machine

  • Any SMTP relay — pass a hostname string or EmailInstance; works with Gmail, SendGrid, SES, and self-hosted servers

  • :material-python: Python 3.8+ compatible — runs on any modern Python; no breaking syntax used