41 lines
1.0 KiB
Plaintext
41 lines
1.0 KiB
Plaintext
Source: emails
|
|
Maintainer: Sergey Lavrinenko <s@lavr.me>
|
|
Section: python
|
|
Priority: optional
|
|
Build-Depends: python-setuptools (>= 0.6b3), python-all (>= 2.6.6-3), debhelper (>= 7.4.3)
|
|
Standards-Version: 3.9.1
|
|
|
|
|
|
Package: python-emails
|
|
Architecture: all
|
|
Depends: ${misc:Depends}, ${python:Depends}
|
|
python-cssutils,
|
|
python-lxml,
|
|
python-chardet,
|
|
python-dateutil,
|
|
python-requests
|
|
Description: Modern python library for emails.
|
|
python-emails
|
|
~~~~~~~~~~~~~
|
|
.
|
|
Modern python library for email.
|
|
.
|
|
Build message:
|
|
.
|
|
.. code-block:: python
|
|
.
|
|
>>> 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:
|
|
.
|
|
.. code-block:: python
|
|
.
|
|
>>> r = message.send(to='s@lavr.me', smtp={'host': 'aspmx.l.google.com', 'timeout': 5})
|
|
|
|
|
|
|