QuickEmail
项目介绍
简易的邮件发信工具。支持认证/不认证发信。
使用UTF-8编码。可以一次连接声明多收件人、抄送人
使用说明
简易的邮件发信工具。支持认证/不认证发信。
使用UTF-8编码。
pip install quickemail
from quickemail import QuickEmail
-
发信前先定义发信要素:
指定主机和端口,必须参数: quicksend = QuickEmail('mail.test.com', 25) # SMTP发信端口,默认是25 SSL链接使用465 quicksend.debug = True # 打开调试,发送错误会抛出异常信息 定义HELO主机名,参数可省略: quicksend.helo = 'QuickEmail' # HELO主机名不能使用有空格的字符串,可以省略 quicksend.tls = True / quicksend.ssl = True # 开启startTLS或者SSL,SSL端口一般为465 认证用户名和密码,authsend()必须的参数: quicksend.mail_user = 'a' # 认证用户名 quicksend.user_pass = 'test' # 认证用户的密码 发信人、收信人为必须参数: quicksend.mail_from = 'AA高A<a@test.com>' # 发信人地址,格式为: FullName<email address> quicksend.mail_to = '一二三<123@test.com>,ABC<abc@test.com>' # 格式同上,多地址使用逗号","分隔 抄送人,可省略: quicksend.mail_cc = '一二三<123@test.com>' 邮件时间定义,可省略: quicksend.mail_date = 1691544067 邮件主题、内容,支持使用HTML: quicksend.mail_subject = 'mY subject还有中文!' quicksend.mail_content = '<font color=red>red content一段中文</font>' quicksend.is_html = True 添加附件,可省略: quicksend.mail_attach = ['abc.jpg'] # 添加附件 类型为list 高级定制,可省略: quicksend.content_from = '邮件显示的假发件人<from@test.com>' # 定制邮件信体显示的发件人,一般为来隐藏实际的mail_from。 quicksend.content_to = '邮件显示的假收件人<to@test.com>' # 定制邮件信体显示的收件人,一般为来隐藏实际的mail_to。 quicksend.content_cc = '邮件显示的假抄送人<cc@test.com>' # 定制邮件信体显示的抄送人,一般为来隐藏实际的mail_cc。 -
使用creatmsg()建立邮件信体内容。(可以忽略)
msg = quicksend.creatmsg() -
使用authsend()或者send()发送邮件,creatmsg()未执行,参数msg可忽略。
quicksend.authsend(msg) quicksend.send() -
错误显示(成功返回True,失败返回False)
result = quicksend.authsend(msg) if result: print("ok")打开调试,发送错误会抛出异常信息
quicksend.debug = True try: quicksend.authsend() except Exception as e: print(e)
Metadata
Release files for quickemail 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| quickemail-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for quickemail-0.4.0-py3-none-any.whl |
Release files / quickemail-0.4.0-py3-none-any.whl
| Download URL | quickemail-0.4.0-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
46aec0600f277771d3608b3454d2ae15af2b3923a80b2241b234dde4c2352130
|
|
BLAKE2b-256 checksum How to use checksums |
247eef8dd55620d15dacba402c73dc13bf751156c0b4da4b8a27000fe395ac01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.11.3 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.6
|
Security for quickemail 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.