Makes sending emails easy and DRY — For Python 3.
Makes sending emails easy and DRY — For Python 3.
Drymail is a minimalist wrapper over Python’s existing smtplib and email libraries, designed to be friendly but unrestrictive. Here’s how you might send a simple email with an attachment using drymail.
from drymail import SMTPMailer, Message
client = 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)
“John Doe" <[email protected]>
format.CC
, BCC
, Reply-To
and Authors
.Install drymail
by running —
$ pip3 install drymail
Documentation is available at https://drymail.readthedocs.io/
Message
class to handle dynamic prepare
.All kinds of contribution are welcome.
This project is licensed under the MIT license.