Posts is a Python library for send mail easily.
Installation
pip install posts
Examples
Here is the first one to send a mail in text:
from posts import Posts
mail = Posts('smtp.qq.com', 'your-username', 'your-passwd')
with mail() as box:
box.text('to_address', subject='Subject', content='Content')
Posts does not only support mail in text type, but also support html:
box.html('to_address', subject='Subject', content='Content')
Next, we can send a mail with attachments:
with mail() as box:
box.attach({'example.jpg': './example.jpg})
box.text('to_address')
Finally, we can send the mail in html type with image:
with mail(alias='alias') as box:
box.attach({
'example.jpg': './example.jpg'})
box.html(
recipient='to_address',
subject='subject',
content='<img src="cid:example.jpg">')
Maybe you need to send mail by ssl, don’t worry:
with mail(ssl=True) as box:
box.text('to_address')
Chain Useage
Just try like this:
box.attach(**kwargs).\
attach(**kwargs).\
text(**kwargs)
Release files for posts 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| posts-0.1.4.tar.gz | 2.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| posts-0.1.4-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 6.7 kB
Release files / posts-0.1.4.tar.gz
| Download URL | posts-0.1.4.tar.gz |
|---|---|
| Size | 2.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
26a6bded303fe7a63f3fb16cb3ea2a4bc7526cb0303b2c2c34d0a24b8cd3bac5
|
|
BLAKE2b-256 checksum How to use checksums |
9c391a31240728aa9aa634c3f330477a1bc63aad7a5b0047563832ff90f87068
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / posts-0.1.4-py2-none-any.whl
| Download URL | posts-0.1.4-py2-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
49bf3cb2f808f92df18ddb2d31d5bc4325344c960fa3e028a603e4cb9aff70d5
|
|
BLAKE2b-256 checksum How to use checksums |
d42b5bc02388113db36e6e7c4788466fdc4fb7f7963207c77f93af3f020718ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |