Skip to main content

一个邮件操作工具类。

Project description

使用手册

1.快速开始

1)配置全局配置

默认搜索路径:emaileer.iniemailer.ini~/emaileer.ini~/emailer.ini

[demo-sender]
host = smtp.qq.com
port = 25
username = 172xxx032@qq.com
password = kafnxxxxtjsgjbhg

[test-sender]
host = smtp.qq.com
port = 25
username = 1727xxxx032@qq.com
password = kafnxxxxtjsgjbhg
fromName = kancy
encoding = utf-8
debug = True

2)使用指定email sender发送邮件

import emaileer

# 发送文本邮件
emaileer.sendText("demo-sender", "测试标题", "hello", "7932xxx61@qq.com")

# 发送Html邮件
emaileer.sendText("demo-sender", "测试标题", "<h3>hello</h3>", "7932xxx61@qq.com")

# 发送Html模板邮件
emaileer.sendText("test-sender", "测试标题", "demo.html", "7932xxx61@qq.com", k1='v1', k2='v2')

# 发送附件邮件
emaileer.sendText("test-sender", "测试标题", "demo.html", "7932xxx61@qq.com", files="file1.txt,file2.txt")

2.使用内置EmailSender

  • QQ邮箱:QQEmailSender
  • 网易邮箱:NeteaseEmailSender
  • 谷歌邮箱:GoogleEmailSender
import emaileer

# 定义一个QQ Email Sender
sender = emaileer.QQEmailSender("1727xxxx32@qq.com", "kafnedgxxxxsgjbhg", fromName="姓名")

# 发送文本邮件
sender.sendText("测试标题", "hello", "7932xxx61@qq.com")

# 发送Html邮件
sender.sendText("测试标题", "<h3>hello</h3>", "7932xxx61@qq.com")

# 发送Html模板邮件
sender.sendText("测试标题", "demo.html", "7932xxx61@qq.com", k1='v1', k2='v2')

# 发送附件邮件
sender.sendText("测试标题", "demo.html", "7932xxx61@qq.com", files="file1.txt,file2.txt")

3.自定义EmailSender

import emaileer

# 自定义
sender = emaileer.EmailSender("smtp.qq.com", 443, "username", "password")
# 发送文本邮件
sender.sendText("测试标题", "hello", "7932xxx61@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

emaileer-0.0.4.tar.gz (7.1 kB view details)

Uploaded Source

Built Distributions

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

emaileer-0.0.4-py3.9.egg (10.3 kB view details)

Uploaded Egg

emaileer-0.0.4-py2.py3-none-any.whl (5.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file emaileer-0.0.4.tar.gz.

File metadata

  • Download URL: emaileer-0.0.4.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for emaileer-0.0.4.tar.gz
Algorithm Hash digest
SHA256 a780ef0a076e0bcc49947e0e7505049c795536d4ee8a32d8ffeaaa6437b8ad40
MD5 ac71a94c771d2c86186f85aef9708838
BLAKE2b-256 9604f8312ea33f9e29013778f6d81d6288c40b382f9a87ff8689002782fa8a96

See more details on using hashes here.

File details

Details for the file emaileer-0.0.4-py3.9.egg.

File metadata

  • Download URL: emaileer-0.0.4-py3.9.egg
  • Upload date:
  • Size: 10.3 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for emaileer-0.0.4-py3.9.egg
Algorithm Hash digest
SHA256 4c3cad90d28b9a9d0f72d0c0d2fa1d2fa31d23145db9ce5012fb44895c08dcda
MD5 c7a6a0c1725bafc7cea92a832243ba11
BLAKE2b-256 d356993aa2b4840490ff28b1cf83718836da7f9baab9b20d698470635bdd989b

See more details on using hashes here.

File details

Details for the file emaileer-0.0.4-py2.py3-none-any.whl.

File metadata

  • Download URL: emaileer-0.0.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for emaileer-0.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1c2e0b837bebb9e7468f98f03aab0a69a24ad6f02686c68b5604240750ffe6b3
MD5 bdae2c89f01284b3aa16d7c93f501197
BLAKE2b-256 347a82ba9b76beafe24545086e424395e58c8f372326dfef7e8beed460355544

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