Skip to content

lavr/python-emails

Folders and files

NameName
Last commit message
Last commit date

Latest commit

906bd5d · Jan 10, 2024
Jan 8, 2024
Jul 7, 2017
Jan 10, 2024
Jun 19, 2020
Mar 6, 2015
Feb 24, 2015
Jun 19, 2020
Jun 19, 2020
Aug 10, 2017
Jan 17, 2017
Mar 8, 2015
Aug 17, 2013
Mar 14, 2015
Jun 20, 2020
May 26, 2019
Sep 30, 2022
Jan 8, 2024

Repository files navigation

python-emails

Modern python library for email.

Build message:

>>> import emails
>>> message = emails.html(html="<p>Hi!<br>Here is your receipt...",
                       subject="Your receipt No. 567098123",
                       mail_from=('Some Store', 'store@somestore.com'))
>>> message.attach(data=open('bill.pdf', 'rb'), filename='bill.pdf')

send message and get response from smtp server:

>>> r = message.send(to='s@lavr.me', smtp={'host': 'aspmx.l.google.com', 'timeout': 5})
>>> assert r.status_code == 250

and more:

  • DKIM signature
  • Render body from template
  • Flask extension and Django integration
  • Message body transformation methods
  • Load message from url or from file

Documentation: python-emails.readthedocs.org

Flask extension: flask-emails



https://github.com/lavr/python-emails/workflows/Tests/badge.svg?branch=master https://coveralls.io/repos/lavr/python-emails/badge.svg?branch=master