Skip to main content

Send Email for Python

功能特性

对 Python 内置模块 email 和 smtplib 的简单封装

安装

目前 lightmail 支持的 Python 环境有 2.7, 3.4, 3.5, 3.6, 3.7

为了简化安装过程,推荐使用 pip 进行安装

pip install lightmail

升级 lightmail 到新版本:

pip install -U lightmail

如果需要安装 GitHub 上最新代码:

pip install https://github.com/ni-ning/lightmail/archive/master.zip

使用

首先需要配置文件 lightmail.cfg, 文件模板可参考 sample.cfg, 配置文件查找路径为

  • 工程当前目录

  • 运行环境家目录

  • 配置目录 etc

使用案例:

from lightmail import send_email

params = {
    "to": "linda@gmail.com",
    "title": "TESTING",
    "content": "Hello Python",
    "attach": ["@/tmp/test.txt"]
}
send_email(**params)

Metadata

Release files for lightmail 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for lightmail 1.0.0
File Interpreter ABI Platform
lightmail-1.0.0-py3-none-any.whl Python 3 none any Details

Release files / lightmail-1.0.0-py3-none-any.whl

Download URL lightmail-1.0.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c24b76d190ff5e05c0b24bcd25e9c1e98624ab8533ff6ab05617b0913a6fea1
BLAKE2b-256 checksum
How to use checksums
2acf74b521148e68a90fe80f0a5c4085fafa247ccf06050007e980159c52cec7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.1

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file

0.0.1

1 release file

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