A Python library for send mail easily
Project description
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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
posts-0.1.4.tar.gz
(2.6 kB
view details)
Built Distribution
posts-0.1.4-py2-none-any.whl
(4.1 kB
view details)
File details
Details for the file posts-0.1.4.tar.gz
.
File metadata
- Download URL: posts-0.1.4.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
26a6bded303fe7a63f3fb16cb3ea2a4bc7526cb0303b2c2c34d0a24b8cd3bac5
|
|
MD5 |
1f8273ce7825d654dcebbbf08f877bba
|
|
BLAKE2b-256 |
9c391a31240728aa9aa634c3f330477a1bc63aad7a5b0047563832ff90f87068
|
File details
Details for the file posts-0.1.4-py2-none-any.whl
.
File metadata
- Download URL: posts-0.1.4-py2-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
49bf3cb2f808f92df18ddb2d31d5bc4325344c960fa3e028a603e4cb9aff70d5
|
|
MD5 |
50bb3a19f00da9cb1cba0120a6cc9b8b
|
|
BLAKE2b-256 |
d42b5bc02388113db36e6e7c4788466fdc4fb7f7963207c77f93af3f020718ed
|