Skip to main content

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

github 中文文档

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

  1. Client(key: str, host: str, data: str, obj: json): Client

init a client by key

  1. client.set_language(language :str) -> bool

set language for the client,default is zh

  1. client.check_connect() -> bool

check the host and key is ok

  1. 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

  1. 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, 快速集成到你的项目

github 英文文档

简单使用

  • 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

  1. Client(key: str, host: str, data: str, obj: json): Client

init a client by key

  1. client.set_language(language :str) -> bool

set language for the client,default is zh

  1. client.check_connect() -> bool

check the host and key is ok

  1. 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

  1. 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

unimail_py_sdk-0.3.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unimail_py_sdk-0.3.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

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

Hashes for unimail_py_sdk-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9efaffa21f0cd1f90566c544ce85f2c4af92110938cfe6282c16bc2e71864b76
MD5 4dc7ec8296e5da125bb0d862a0d9fa71
BLAKE2b-256 83d948be3551bf4d81f91f74dc23a8b007c9fa2ab726e492539f63c4ae4cc621

See more details on using hashes here.

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

Hashes for unimail_py_sdk-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 333b3aeff5ae2762c355933a7a7dea59df79387dbf36d4b0576a4cc1fb9d32b6
MD5 31706bb691988fb958c7fbb11f8a0998
BLAKE2b-256 f1b7eb82ec8c417caab9a9f6854f15b45a5e5e6a6d25ddae3079f8558f7f3688

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page