This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
python-emails/README.rst

51 lines
1.4 KiB
ReStructuredText
Raw Permalink Normal View History

python-emails
2015-03-08 22:49:45 +01:00
~~~~~~~~~~~~~
2013-08-14 20:52:22 +02:00
2015-03-08 22:49:45 +01:00
Modern python library for email.
2013-08-14 20:52:22 +02:00
2015-03-08 22:49:45 +01:00
Build message:
2015-02-25 13:02:13 +01:00
.. code-block:: python
2015-03-08 22:49:45 +01:00
>>> 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'), filename='bill.pdf')
2015-03-01 10:49:55 +01:00
2015-03-08 22:49:45 +01:00
send message and get response from smtp server:
2015-02-21 21:56:59 +01:00
2015-02-25 13:02:13 +01:00
.. code-block:: python
2015-03-08 22:49:45 +01:00
>>> r = message.send(to='s@lavr.me', smtp={'host': 'aspmx.l.google.com', 'timeout': 5})
>>> assert r.status_code == 250
2013-08-15 01:30:50 +02:00
2015-03-08 22:49:45 +01:00
and more:
2013-08-15 01:30:50 +02:00
2015-03-08 22:49:45 +01:00
* DKIM signature
* Render body from template
* Flask extension and Django integration
* Message body transformation methods
* Load message from url or from file
2013-08-15 01:30:50 +02:00
2015-03-08 22:49:45 +01:00
|
2015-01-30 18:19:58 +01:00
2015-04-01 22:17:08 +02:00
Documentation: `python-emails.readthedocs.org <http://python-emails.readthedocs.org/>`_
Flask extension: `flask-emails <https://github.com/lavr/flask-emails>`_
2015-01-30 18:19:58 +01:00
2015-03-08 22:49:45 +01:00
|
|
2015-01-30 18:19:58 +01:00
2013-08-16 17:36:01 +02:00
.. image:: https://travis-ci.org/lavr/python-emails.png?branch=master
2015-02-27 13:59:50 +01:00
:target: https://travis-ci.org/lavr/python-emails
2015-02-25 12:23:16 +01:00
2015-02-25 13:02:13 +01:00
.. image:: https://img.shields.io/pypi/v/emails.svg
2015-02-27 13:59:50 +01:00
:target: https://pypi.python.org/pypi/emails
2015-02-25 13:02:13 +01:00
2015-02-25 12:23:16 +01:00
.. image:: http://allmychanges.com/p/python/emails/badge/
2015-02-27 13:59:50 +01:00
:target: http://allmychanges.com/p/python/emails/?utm_source=badge
2015-02-27 10:43:07 +01:00
.. image:: https://coveralls.io/repos/lavr/python-emails/badge.svg?branch=master
2015-02-27 13:59:50 +01:00
:target: https://coveralls.io/r/lavr/python-emails?branch=master