coding-python-send-mail

Send email from Python or the shell with streamed attachments, STARTTLS, and multi-host failover.

1|Updated Jun 23, 2026
One-click install
npx skills add https://github.com/bitranox/bitranox-skills --skill coding-python-send-mail-bitranox
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: coding-python-send-mail
Source: https://github.com/bitranox/bitranox-skills/tree/main/plugins/bitranox/skills/coding-python-send-mail
Command: npx skills add https://github.com/bitranox/bitranox-skills --skill coding-python-send-mail-bitranox

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires btx_lib_mail.

What problem does it solve? Sending email from Python with large attachments, correct UTF-8 encoding, STARTTLS authentication, and failover across SMTP hosts is error-prone when hand-rolled with smtplib and the email package, and naive approaches load entire attachments into memory. ## Core Features & Use Cases - Streamed large attachments: Sends multi-gigabyte files with bounded memory via disk-backed spooling and RFC 3030 BDAT/CHUNKING, falling back to DATA with dot-stuffing automatically. - Library and CLI: Use btx_lib_mail.send(...) in Python or the zero-install uvx btx-lib-mail send ... CLI for shell and agent workflows, with multi-host failover and STARTTLS plus authentication. - Attachment security: Blocks path traversal, symlinks, sensitive files, dangerous extensions, and oversize payloads before any bytes are read. - Use Case: A nightly backup job sends a 20 GB archive to an archive address from a low-memory server by raising attachment_max_size_bytes and streaming the file to an authenticated STARTTLS relay with a failover host. ## Quick Start Ask the AI to send an email with a large attachment from Python using the btx_lib_mail library, with STARTTLS, credentials, and a raised attachment size cap.

Frequently Asked Questions about coding-python-send-mail

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I send email with large attachments in Python without running out of memory?▼

Use btx_lib_mail.send with attachment_file_paths, which streams files from disk in fixed-size chunks so peak memory stays near one chunk. Raise attachment_max_size_bytes above the 25 MiB default, and ensure about 1.33x the file size in scratch disk for base64 encoding.

How do I send email from the command line without installing anything?▼

Run uvx btx-lib-mail send with --host, --sender, --recipient, --subject, and --body flags, which executes the CLI directly from PyPI with no persistent install. Pass the password via the BTX_MAIL_SMTP_PASSWORD environment variable rather than a command-line flag.

Does btx_lib_mail support STARTTLS and SMTP authentication?▼

Yes, STARTTLS is enabled by default with certificate verification, and credentials are passed as a tuple to send or via configuration. For self-signed internal relays, set starttls_verify=False to keep encryption while skipping validation.

Why does sending a large attachment fail even when I pass None for the size limit?▼

Passing None for attachment_max_size_bytes on the send call is the sentinel for no override, so the 25 MiB default still applies and the send fails. Pass an explicit byte count larger than the file; None disables the check only on the conf object.

Why is my attachment rejected by the security checks?▼

Attachments are rejected for path traversal, symlinks, sensitive patterns like .ssh or .env, system directories, dangerous extensions, and oversize payloads. The dangerous-extension set is OS-selected, so pass attachment_blocked_extensions or an allowlist when deliberately sending such files.