larzemail
Build, parse and send MIME email the easy way.
A one-object API over Python's email package: subject, from/to/cc/bcc, text and/or HTML bodies, and attachments become valid MIME bytes; parse() round-trips a raw message back to a ParsedEmail. Sends over SMTP with an injectable connection for testing.
larzscript pkg install email
What you get
- One-object build -> valid MIME
- Text + HTML + attachments
- parse() round-trips a raw message
- SMTP send, injectable for tests
Try it
import "email" as email
let msg = email.build({
"from": "a@example.com", "to": ["b@example.com"], "subject": "Hi",
"text": "plain body", "html": "<p>html body</p>"
})
print(email.parse(msg)["subject"])
print(email.parse(msg)["text"])
print(email.parse(msg)["html"])Output
Hi plain body <p>html body</p>
Why it's in the Larz Stack
larzemail is a real Larzscript package (larzscript pkg install email) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.