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:
```python
# 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](https://pypi.org/project/pywin32/))
* Mozilla Thunderbird
On Unix systems, mailcomposer can also access other email applications via the `xdg-email` utility from [xdg-utils](https://freedesktop.org/wiki/Software/xdg-utils/). However, some features like setting the body format are not supported using `xdg-email`.
* 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:
```python
# 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](https://pypi.org/project/pywin32/))
* Mozilla Thunderbird
On Unix systems, mailcomposer can also access other email applications via the `xdg-email` utility from [xdg-utils](https://freedesktop.org/wiki/Software/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.1.tar.gz
(8.0 kB
view details)
Built Distribution
File details
Details for the file mailcomposer-0.2.1.tar.gz
.
File metadata
- Download URL: mailcomposer-0.2.1.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0d4abc00608bbee0881496fc2a83b6228d53bfe15bef020050e6b88368afaf1 |
|
MD5 | f0e32b4fc178829486db8adb3eda850b |
|
BLAKE2b-256 | f3b349a6b7eda05007c2b18f29ffe97f1e7b2ae70cc095faf72f2adea60e599f |
File details
Details for the file mailcomposer-0.2.1-py2.py3-none-any.whl
.
File metadata
- Download URL: mailcomposer-0.2.1-py2.py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee516716f9fa18d148d53bd5bb1caaaa15a8a62ee5006c7b01b29b7de21f873d |
|
MD5 | 53262d13e8bcb90149e1171b51732ba4 |
|
BLAKE2b-256 | cf9e392f82958d6e7ee6d0622760b92a230f79c52827f8e4a828e18ef75c0366 |