Skip to main content
The email package provides tools for managing email messages, including MIME and other RFC 2822-based message documents.

Module Import

Creating Email Messages

Simple Text Email

HTML Email

Email with Attachment

Sending Email

Using SMTP

Using Gmail

Parsing Email Messages

MIME Multipart

Practical Example

Email Utility Class

For Gmail, use an App Password instead of your regular password for better security.
Never hardcode email credentials in your source code. Use environment variables or secure credential storage.

smtplib

SMTP protocol client

json

JSON encoding/decoding