Registry / communication / redmail

redmail

JSON →
library0.6.0pypypi✓ verified 86d ago

Red Mail is a modern email sending library for Python that allows sending emails with attachments, embedded images, Jinja templating, and support for multiple email protocols (SMTP, Outlook, Gmail, etc.). The current version is 0.6.0, with an active release cadence. It requires Python >=3.6.

pip install redmail
INSTALL
IMPORT
SIG · REDMAIL
R
redmail
communicationpythonv0.6.0
Install
1.8s avg
Import
355ms
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.6.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.372s · 19.4MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.8s · import 0.337s · 20MB
18MB installed
● package 18MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

EmailSender
from redmail import EmailSender
Main class for sending emails.
GmailSender
from redmail import GmailSender
from redmail.gmail import GmailSender
GmailSender is directly from redmail, not a submodule.
OutlookSender
from redmail import OutlookSender
from redmail.outlook import OutlookSender
OutlookSender is directly from redmail, not a submodule.

Basic usage: create an EmailSender with SMTP credentials and send a simple email.

from redmail import EmailSender email = EmailSender( host="smtp.example.com", port=587, username="user@example.com", password="secret", use_startls=True ) email.send( subject="Example", receivers=["recipient@example.com"], text="Hello!", html="<h1>Hello!</h1>" )
Debug
Known issues
gotchaThe `user_name` parameter was renamed to `username` in v0.4.0. Using `user_name` will raise an error.
fix
Use `username=...` instead of `user_name=...`.
affects: >=0.4.0
deprecatedThe `password` parameter is still accepted but its use is deprecated; use `password` is fine, but consider using environment variables or a secrets manager.
fix
No immediate change, but avoid hardcoding credentials.
affects: >=0.5.0
gotchaWhen using `send` with `text` and `html` arguments, the email structure might be multipart/alternative. If you don't set a text body, some clients may not display HTML properly.
fix
Always provide both `text` and `html` unless you intend plain text only.
affects: all
gotchaEmbedded images require a valid Content-ID; if the image is not embedded correctly, it may not display. Use `embed_image` parameter with image path or bytes.
fix
Refer to docs: pass image as `attachments` with `content_id`.
affects: all
Errors
Common errors & fixes
AttributeError: 'EmailSender' object has no attribute 'user_name'
The parameter `user_name` was renamed to `username` in v0.4.0.
fix
Use `username='your@email.com'` instead of `user_name='...'`.
ModuleNotFoundError: No module named 'pandas'
Tried to use pandas-related features (like table prettifying) without having pandas installed.
fix
Install pandas with `pip install pandas` or install redmail with extras: `pip install redmail[pandas]`.
smtplib.SMTPAuthenticationError: (535, b'5.7.8 Username and Password not accepted')
Incorrect email credentials or less secure app access not enabled (for Gmail).
fix
Check username/password, enable less secure app access or use an app password.
Upgrade
Version history
0.6.0latest on PyPI · released Feb 25, 2023
Audit
Dependencies
jinja2optionalRequired for Jinja templating; included automatically.
pandasoptionalOptional for table prettifying with DataFrames.
Agent activity
27 hits · last 30 days
node
24
OpenAI (training)
1
Resources
redmail — pip install redmail · libregistry