This is a Python SDK for Unimail. Quickly integrate into your project
Project description
unimal-py-sdk
The current SDK version is v2. If you need to use the previous v1 version, please switch to the v1 branch.
This is a Python SDK for Unimail. Quickly integrate into your project
usage
- pip install
pip install unimail-py-sdk
- init a unimail client
you need a authorization key.
main.py
from unimail_py_sdk import UnimailReq, Client, Result
# please input your key here
key: str = ""
client: Client = Client(key)
result = client.check_connect()
print(result)
- send email
req = UnimailReq(
# from_name= "",
receivers=["email"],
# cc=["email"],
# bcc=["email"],
subject="test",
html_content="test",
)
req.append_file("att1.txt", path = "tests/attachment.txt")
result: Result = client.send_email(req)
for key, val in result.__dict__.items():
print(f"{key}: {val}")
api docs
- Client(key: str, host: str, data: str, obj: json): Client
init a client by key
- client.set_language(language :str) -> bool
set language for the client,default is zh
- client.check_connect() -> bool
check the host and key is ok
- client.send_email(req :UnimailReq) -> Result
please see usage
support language
chinese is the default language for the sdk.
- english (en)
- simple chinese (zh)
- vietnamese (vi)
- idonesian (id)
- thai (th)
- gujarati (gu)
if you want to support other language, please open a issue.
- tips
If you want to use this SDK, please contact the author via admin@allcloud.top.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unimail_py_sdk-1.0.0.tar.gz.
File metadata
- Download URL: unimail_py_sdk-1.0.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ff7e76b13fd21820c503c4a3c3031fd8a41c9d6f8d091bb7aec6653683f9a19
|
|
| MD5 |
bde8008dfeaf457000a49958dea683d6
|
|
| BLAKE2b-256 |
c3331483b87db8315630e332fc1c5c3e2e87e6cbc06d8cbf2ff33a73a10fc384
|
File details
Details for the file unimail_py_sdk-1.0.0-py3-none-any.whl.
File metadata
- Download URL: unimail_py_sdk-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1532ceffe69dfe6f2a6a8ba83d05cbde3195c4576b9561ba53383628678035a0
|
|
| MD5 |
19926de91dd342921f4d64fc835f8efb
|
|
| BLAKE2b-256 |
22b172c98ffaa3e6f4bb070cc1f8115d4b22ee7ac3fed82f88f51e1b25d83e03
|