This is a Python SDK for Unimail. Quickly integrate into your project
Project description
unimal-py-sdk
This is a Python SDK for Unimail. Quickly integrate into your project
simple usage
- pip install
pip install unimail-py-sdk
- init a unimail client
you need a authorization key.
main.py
from unimail-py-sdk import Client, Result
# please input your key here
key: str = ""
client: Client = Client(key)
client.check_connect()
- send email
example
receiver: aaa@gmail.com
email subject: email subject
email content: this is a email content
result: Result := client.send_email("aaa@gmail.com", "email subject", "this is a email content")
if result.is_success:
print("send email success")
else:
print(f"send email fail, error: {result.msg}")
- batch send email
example
receivers: aaa@gmail.com,bbb@gmail.com
email subject: email subject
email content: this is a email content
result: Result := client.batch_send_email("aaa@gmail.com", "email subject", "this is a email content")
if result.is_success:
print("send email success")
else:
print(f"send email fail, error: {result.msg}")
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(receiver :str, subject :str, content :str) -> Result
send email to receiver. if you have many receiver, you can concat the receiver by ";" or use BatchSendEmail
- client.batch_send_email(receivers :list, subject :str, content :str) -> Result
like SendEmail, but receivers is a slice
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 i-curve@qq.com.
unimal-py-sdk
unimail 的 python 语言 sdk, 快速集成到你的项目
简单使用
- pip 安装包
pip install unimail-py-sdk
- 初始化客户端
你需要申请一个 key
main.py
from unimail-py-sdk import Client, Result
# please input your key here
key: str = ""
client: Client = Client(key)
client.check_connect()
- 发邮件
例如
收件人: aaa@gmail.com
邮件标题: email subject
邮件正文: this is a email content
result: Result := client.send_email("aaa@gmail.com", "email subject", "this is a email content")
if result.is_success:
print("send email success")
else:
print(f"send email fail, error: {result.msg}")
- 批量发送邮件
例如
收件人: aaa@gmail.com,bbb@gmail.com
邮件标题: email subject
邮件正文: this is a email content
result: Result := client.batch_send_email("aaa@gmail.com", "email subject", "this is a email content")
if result.is_success:
print("send email success")
else:
print(f"send email fail, error: {result.msg}")
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(receiver :str, subject :str, content :str) -> Result
send email to receiver. if you have many receiver, you can concat the receiver by ";" or use BatchSendEmail
- client.batch_send_email(receivers :list, subject :str, content :str) -> Result
like SendEmail, but receivers is a slice
支持的语言
sdk 默认返回的 msg 为中文
- english (en)
- simple chinese (zh)
- vietnamese (vi)
- idonesian (id)
- thai (th)
- gujarati (gu)
如果你需要添加了更多语言,欢迎提 issue
- 提示
如果想要使用 unimail sdk, 请通过邮件联系作者 i-curve@qq.com
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-0.3.0.tar.gz.
File metadata
- Download URL: unimail_py_sdk-0.3.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.12.7 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9efaffa21f0cd1f90566c544ce85f2c4af92110938cfe6282c16bc2e71864b76
|
|
| MD5 |
4dc7ec8296e5da125bb0d862a0d9fa71
|
|
| BLAKE2b-256 |
83d948be3551bf4d81f91f74dc23a8b007c9fa2ab726e492539f63c4ae4cc621
|
File details
Details for the file unimail_py_sdk-0.3.0-py3-none-any.whl.
File metadata
- Download URL: unimail_py_sdk-0.3.0-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.12.7 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
333b3aeff5ae2762c355933a7a7dea59df79387dbf36d4b0576a4cc1fb9d32b6
|
|
| MD5 |
31706bb691988fb958c7fbb11f8a0998
|
|
| BLAKE2b-256 |
f1b7eb82ec8c417caab9a9f6854f15b45a5e5e6a6d25ddae3079f8558f7f3688
|