Skip to main content

Posts

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)

Metadata

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)

Source distribution for posts 0.1.4
File Size Uploaded Provenance Actions
posts-0.1.4.tar.gz 2.6 kB Without provenance Details for posts-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for posts 0.1.4
File Interpreter ABI Platform Actions
posts-0.1.4-py2-none-any.whl Python 2 none any Details for posts-0.1.4-py2-none-any.whl

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

Security for posts 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page