• Stars
    star
    384
  • Rank 109,400 (Top 3 %)
  • Language
    Python
  • License
    Other
  • Created almost 11 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Modern python library for emails

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', '[email protected]'))
>>> message.attach(data=open('bill.pdf', 'rb'), filename='bill.pdf')

send message and get response from smtp server:

>>> r = message.send(to='[email protected]', 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