KMailBox
kmailbox is a python email library, support for sending and receiving emails via SMTP and IMAP protocol.
send plain text email:
from kmailbox import Message, MailBox
msg = Message()
msg.sender = "Tester<test@google.com>"
msg.recipient = "hello@google.com"
msg.subject = "kmailbox test"
msg.content = "This is test"
mailbox = MailBox(smtp_host="smtp.gmail.com", use_tls=True)
mailbox.username = "username"
mailbox.password = "password"
mailbox.send(msg)
send html email:
msg = Message()
msg.sender = "Tester<test@google.com>"
msg.recipient = "hello@google.com"
msg.subject = "kmailbox test send html and add attachments"
msg.is_html = True
msg.content = """\
<body>
<p><img src="cid:0"></p>
<p>Hello! I am <em>Huoty</em>.</p>
<p>How are you?</p>
<p>Give you a picture:</p>
<p><img src="cid:1"></p>
</body>
"""
msg.attachments = [
"cid0:imgs/mailbox-icon.png",
"cid1:imgs/20171005170550.jpg",
"kmailbox.py",
"README.md"
]
mailbox = MailBox(
smtp_host="smtp.gmail.com",
use_ssl=True,
username="username",
password="password",
)
mailbox.send(msg)
receive mails:
mailbox = MailBox(imap_host="imap.gmail.com", use_ssl=True)
mailbox.username = "username"
mailbox.password = "password"
mailbox.select()
for mail in mailbox.all(mark_seen=False, gen=True):
pprint({
"uid": mail.uid,
"sender": mail.sender,
"to_addrs": mail.to_addrs,
"subject": mail.subject,
"date": str(mail.date),
"flags": mail.flags,
"attachments": [att.filename for att in mail.attachments],
})
mailbox.close()
Metadata
Release files for kmailbox 0.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| kmailbox-0.2.5.tar.gz | 14.6 kB | Without provenance | Details for kmailbox-0.2.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kmailbox-0.2.5-py3-none-any.whl | Python 3 | none | any | Details for kmailbox-0.2.5-py3-none-any.whl |
Total release size: 28.9 kB
Release files / kmailbox-0.2.5.tar.gz
| Download URL | kmailbox-0.2.5.tar.gz |
|---|---|
| Size | 14.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1f3a3cca9b4d4856a145d99ef96313270d613d227ad973a65cfdf51a160ad197
|
|
BLAKE2b-256 checksum How to use checksums |
bbb47a10246afe3d0af3f7b85b57ff09708ebd18c86214fb67d4aa269bf6b608
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / kmailbox-0.2.5-py3-none-any.whl
| Download URL | kmailbox-0.2.5-py3-none-any.whl |
|---|---|
| Size | 14.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
12c755ce508458c8d78871dcc32eedfaedb269c279a1d26f27d7091b949e579a
|
|
BLAKE2b-256 checksum How to use checksums |
c08f4aa4b340faaf56399b4a3702a1a58c9de2719a144c5bca1ee02332675471
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Security for kmailbox 0.2.5
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.