Registry / communication / email
library4.0.2pypypiunverified

Standalone email package version 4.0.2. Originally part of Python's stdlib, now available as a standalone backport with improvements for modern Python. Provides classes for parsing, generating, and sending email messages, including MIME support. Release cadence is low (latest 4.0.2 from 2024).

pip install email
INSTALL
IMPORT
SIG · EMAIL
E
email
communicationpythonv4.0.2
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
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.95 runs
build_error
glibc
py 3.103.95 runs
build_error
Code
Verified usage

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

Message
from email.message import EmailMessage
from email import Message
Direct import of 'Message' from 'email' module is wrong; use EmailMessage or MIMEText.
MIMEText
from email.mime.text import MIMEText
from email import MIMEText
MIMEText is in email.mime.text, not top-level email.

Create and print a simple email message using EmailMessage.

from email.message import EmailMessage msg = EmailMessage() msg.set_content('Hello, world!') msg['Subject'] = 'Test' msg['From'] = 'you@example.com' msg['To'] = 'recipient@example.com' print(msg.as_string())
Debug
Known issues
breakingIn Python 3.6+, the 'email' stdlib module changed significantly. The standalone 'email' package (backport) may conflict with stdlib imports. Prefer using stdlib unless you need features from the backport.
fix
If you are using Python 3.6+, avoid installing the standalone 'email' package unless necessary, as it can shadow the stdlib module.
affects: >=4.0.0
deprecatedThe old 'email.Message' class is deprecated. Use 'email.message.EmailMessage' instead.
fix
Replace 'from email.Message import Message' with 'from email.message import EmailMessage'.
affects: >=4.0.0
gotchaWhen setting email headers, do not use the 'Message.__setitem__' method directly for multiple headers of the same name (e.g., 'Received'). Use 'Message.add_header' to add multiple values.
fix
Use msg.add_header('Received', 'from localhost') for repeated headers.
affects: all
gotchaWhen attaching binary files, ensure you handle encoding correctly. For Python 3, use 'email.mime.base.MIMEBase' with 'Content-Transfer-Encoding: base64'.
fix
Example: part = MIMEBase('application', 'octet-stream'); part.set_payload(data); encode_base64(part).
affects: all
Upgrade
Version history
4.0.2latest on PyPI · released Apr 25, 2007
Audit
Dependencies

No dependency data recorded yet.

Agent activity
33 hits · last 30 days
node
28
OpenAI (training)
1
Resources
email — pip install email · libregistry