Skip to content

Exchange Emailer

Send emails via Microsoft Exchange Server with HTML template support

PyPI Python Versions License


Overview

ExMailer is a Python library designed to simplify sending emails and scheduling meetings through Microsoft Exchange Server with full support for HTML text formatting.

Key Features

  • Calendar Management - Schedule, update, and cancel meetings natively
  • Microsoft Exchange Integration - Seamless NTLM authentication
  • Bi-directional Language Support - Persian (RTL) and English (LTR) templates
  • Professional HTML Templates - Customizable email and meeting templates
  • Attachment Support - Multiple files with automatic MIME detection
  • Flexible Configuration - Environment variables, JSON, or programmatic setup
  • CLI Interface - Command-line tool for quick operations
  • Secure SSL/TLS - Certificate verification and encryption

Quick Example

from exmailer import ExchangeEmailer

with ExchangeEmailer() as emailer:
    emailer.send_email(
        subject="Hello There 👋🏻",
        body="<p>Test email</p>",
        recipients=["colleague@company.com"],
    )
import datetime
from zoneinfo import ZoneInfo
from exmailer import ExchangeEmailer

tz = ZoneInfo("Asia/Tehran")

with ExchangeEmailer() as emailer:
    ids = emailer.send_meeting_invite(
        subject="Project Kickoff",
        start=datetime.datetime(2026, 6, 25, 10, 0, tzinfo=tz),
        end=datetime.datetime(2026, 6, 25, 11, 0, tzinfo=tz),
        required_attendees=["team@company.com"]
    )
    # ids.uid is the durable RFC 5545 UID — safe to persist as a DB key.