Skip to main content

API for composing emails through an external application

Project description

mailcomposer aims to provide a simple, cross-platform interface for composing emails through an external application like Microsoft Outlook. Some reasons you might use it are:

  • You're behind a corporate firewall, and are only able to send email using Outlook.
  • You don't have an SMTP server, or don't want the hassle of using smtplib.
  • You just prefer your desktop email client.

Here's how easy it is to use:

# This automatically selects an appropriate email application
from mailcomposer import MailComposer
mc = MailComposer()

# Set some message headers
mc.to = "nobody@example.com"
mc.subject = "Testing mailcomposer"

# Set the message body
mc.body = "This is a demonstration of the mailcomposer package."

# Attach this README file
mc.attach_file("README.md")

# Display the message in your email application
mc.display()

The mailcomposer module can also be called as a script from the command line. When used this way, it provides an interface similar to the Unix mail utility. For more information, try python -m mailcomposer --help.

Features

Notable features include:

  • Straightforward API
  • Cross-platform
  • Runs on both Python 2 and 3
  • Uses your desktop email client; no SMTP server required
  • To, CC, and BCC fields accept single recipients or Python lists
  • Messages can be composed in either plain-text or HTML format
  • Attachments are easy -- just pass the filename

Supported Email Applications

Supported email applications currently include:

  • Microsoft Outlook (Windows only; requires pywin32)
  • Mozilla Thunderbird

On Unix systems, mailcomposer can also access other email applications via the xdg-email utility from xdg-utils. However, some features like setting the body format are not supported using xdg-email.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mailcomposer-0.2.3.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

mailcomposer-0.2.3-py2.py3-none-any.whl (11.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file mailcomposer-0.2.3.tar.gz.

File metadata

  • Download URL: mailcomposer-0.2.3.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.0.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

File hashes

Hashes for mailcomposer-0.2.3.tar.gz
Algorithm Hash digest
SHA256 2581b7b7dc209e4d863f2d2af25e63837c74d488decf26746a29d8df87558469
MD5 88d65c628688ded510a4d7bfabd94bdf
BLAKE2b-256 5d5c67f8f197f7b0b1e26fa3aa4dc22bdb3c03140eaa65a92f87b9bfdebd1bed

See more details on using hashes here.

File details

Details for the file mailcomposer-0.2.3-py2.py3-none-any.whl.

File metadata

  • Download URL: mailcomposer-0.2.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.0.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

File hashes

Hashes for mailcomposer-0.2.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9844aecd3f577b1c0e580166ad6e81905691ba021cd51e4a8f1f311f0495a7d5
MD5 240335a7f90437af3ba0dfd0f2082961
BLAKE2b-256 3b9f63c56a914e3dd1103c0b1b418478f693b4c00cab2c2db75a6dffc0138e6c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page