https://github.com/skulltech/drymail
Makes sending emails easy and DRY — For Python 3.
https://github.com/skulltech/drymail
email email-sender python python3 smtp smtp-client
Last synced: 23 days ago
JSON representation
Makes sending emails easy and DRY — For Python 3.
- Host: GitHub
- URL: https://github.com/skulltech/drymail
- Owner: skulltech
- License: mit
- Created: 2019-01-12T09:13:19.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-01-07T09:45:41.000Z (over 4 years ago)
- Last Synced: 2025-03-30T19:08:19.276Z (about 1 month ago)
- Topics: email, email-sender, python, python3, smtp, smtp-client
- Language: Python
- Homepage: https://drymail.readthedocs.io/
- Size: 30.3 KB
- Stars: 220
- Watchers: 10
- Forks: 18
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# drymail
Makes sending emails easy and [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) — For Python 3.[](https://badge.fury.io/py/drymail)
__Drymail__ is a minimalist wrapper over Python’s existing [smtplib](https://docs.python.org/3/library/smtplib.html) and [email](https://docs.python.org/3/library/email.html) libraries, designed to be friendly but unrestrictive. Here’s how you might send a simple email with an attachment using _drymail_.
```python
from drymail import SMTPMailer, Messageclient = SMTPMailer(host='smtp.email.com', user='johndoe', password='password', tls=True)
message = Message(subject='Congrats on the new job!', sender=('John Doe', '[email protected]'),
receivers=[('Jane Doe', '[email protected]'), '[email protected]'], text='When is the party? ;)')
message.attach(filename='/path/to/congrats.pdf', mimetype='application/pdf')client.send(message)
```## Features
- Supports creating email with HTML content, plaintext content, or both!
- Supports mentioning contacts in the `“John Doe" ` format.
- Support standard headers like `CC`, `BCC`, `Reply-To` and `Authors`.
- Supports injecting custom headers.
- Supports adding attachments.
- And most importantly — the library being minimalist, it doesn’t restrict you in any way like some of the most fancier email frameworks do.## Installation
Install `drymail` by running —
```console
$ pip3 install drymail
```## Documentation
Documentation is available at https://drymail.readthedocs.io/
## Agenda
- Test suite.
- Restructure the `Message` class to handle dynamic `prepare`.## Contribute
All kinds of contribution are welcome.
- Issue Tracker — https://github.com/drymail/issues
- Source Code — https://github.com/drymail## License
This project is licensed under the MIT license.