Skip to main content

A quick mail sender, postman

Project description

Quick Poster

一个简单易用的邮件发送工具,基于Python实现。

项目简介

Easy Mail Sender是一个轻量级的邮件发送库,旨在简化Python应用程序中的邮件发送流程。它提供了简洁的API,使您能够轻松地发送电子邮件,而无需处理底层的SMTP细节。

特性

  • 简单易用的API
  • 支持SSL加密连接
  • 基于环境变量的配置管理
  • 使用数据类进行邮件信息的结构化管理

安装

使用PDM安装:

pdm add easy-mail-sender

或者使用pip:

pip install easy-mail-sender

配置

在使用之前,您需要设置以下环境变量:

EMAIL_HOST_USER=your_email@example.com
EMAIL_HOST_PASSWORD=your_email_password

您可以创建一个.env文件在项目根目录下,或者直接在环境中设置这些变量。

使用示例

from easy_mail_sender import MailInfo, MailWorker

# 创建邮件信息
mail_info = MailInfo(
    receiver_email="recipient@example.com",
    subject="测试邮件",
    body="这是一封测试邮件的内容。"
)

# 创建邮件工作器并发送邮件
worker = MailWorker(mail_info)
worker.send()

自定义SMTP服务器

默认情况下,Easy Mail Sender使用腾讯企业邮箱的SMTP服务器。如果您需要使用其他SMTP服务器,可以在创建MailWorker实例后修改相关属性:

worker = MailWorker(mail_info)
worker.mail_server = "smtp.gmail.com"
worker.port = 587
worker.send()

开发

环境设置

  1. 克隆仓库:
git clone https://github.com/yourusername/easy-mail-sender.git
cd easy-mail-sender
  1. 使用PDM安装依赖:
pdm install

运行测试

pdm run pytest

许可证

本项目采用MIT许可证 - 详情请参阅LICENSE文件。

贡献

欢迎提交问题和拉取请求!

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

quick_postman-0.1.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

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

quick_postman-0.1.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file quick_postman-0.1.0.tar.gz.

File metadata

  • Download URL: quick_postman-0.1.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for quick_postman-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f6d8794b8b0dfdd445929c6fb3bc4bd8fd23a6098be6b1c0476eb9f43abc6af3
MD5 a81b86e9f48bc6aabff748fb98f37e67
BLAKE2b-256 619d4ee69459b5d186f8a9dd323299c9952aec26668c0d565453f6c2f54830e0

See more details on using hashes here.

File details

Details for the file quick_postman-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: quick_postman-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for quick_postman-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3212a239cae18bc33922beee8cfba7388a9e3d410069f8c21c6e29a7af1afb26
MD5 68fd8d5b84a4e25a2c0450085a14b116
BLAKE2b-256 5ee2f769ec6b0c770e4bc61c11e0c221f5bca1907f314de76323d2099fbd075b

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