Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ni-ning/lightmail
Send Email for Python
https://github.com/ni-ning/lightmail
Last synced: about 10 hours ago
JSON representation
Send Email for Python
- Host: GitHub
- URL: https://github.com/ni-ning/lightmail
- Owner: ni-ning
- License: mit
- Created: 2019-11-25T10:56:28.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-28T02:28:00.000Z (almost 5 years ago)
- Last Synced: 2024-10-13T22:47:55.014Z (about 1 month ago)
- Language: Python
- Size: 13.7 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
################################
Send Email for Python
################################
.. image:: https://img.shields.io/badge/pypi-v1.0.0-blue
:target: https://pypi.org/project/lightmail/**********
功能特性
**********对 Python 内置模块 email 和 smtplib 的简单封装
********
安装
********目前 lightmail 支持的 Python 环境有 2.7, 3.4, 3.5, 3.6, 3.7
为了简化安装过程,推荐使用 pip 进行安装
.. code-block:: bash
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": "[email protected]",
"title": "TESTING",
"content": "Hello Python",
"attach": ["@/tmp/test.txt"]
}
send_email(**params)