Skip to main content

Python版邮件客户端。通过代理服务器发送邮件。

Project description

python-sendmail

Python版邮件客户端。通过代理服务器发送邮件。

安装

pip install python-sendmail

安装的可执行程序

  • pysendmail

程序帮助信息

D:\code\python-sendmail>pysendmail --help
Usage: pysendmail [OPTIONS] [CONTENT]

  通过代理服务器发送邮件。

  注意:

  如果命令行中没有提供邮件内容,则表示从STDIN中获取邮件内容。

Options:
  -f, --from-address TEXT  发件人,如:姓名 <name@example.com>、name@example.com。
                           [required]
  -t, --to-address TEXT    收件人,如:姓名 <name@example.com>、name@example.com。
                           [required]
  -s, --subject TEXT       邮箱主题。
  -a, --attach TEXT        邮件附件,可以使用多次。
  --html                   使用HTML格式。
  -e, --encoding TEXT      邮件内容编码格式,默认为UTF-8。
  -h, --host TEXT          邮箱代理服务器地址,默认为127.0.0.1。
  -p, --port INTEGER       邮箱代理服务器端口,默认为25。
  --ssl                    邮箱代理服务器要求使用ssl加密链接。
  -u, --user TEXT          邮箱代理服务器帐号,不提供则表示无需帐号认证。
  -P, --password TEXT      邮箱代理服务器密码,不提供则表示无需帐号认证。
  --help                   Show this message and exit.

使用案例

使用远程代理服务器,有认证,无附件

pysendmail -h stmp.example.com -p 465 --ssl -u sender@example.com -P senderPassword -f 'SENDER <sender@exmaple.com>' -t recipient@exmaple.com -s 'just a test mail' 'just a test mail'

使用本地代理服务器,无认证,有附件

  • 发件人:sender@exmaple.com
  • 收件人:recipient@exmaple.com
  • 主题:just a test mail
  • 内容:just a test mail
  • 服务器地址:127.0.0.1
  • 服务器端口:25
  • 是否使用ssl安全链接:否
  • 帐号:无认证
  • 密码:无认证
  • 附件:/path/to/attachment.pdf
pysendmail -f sender@exmaple.com -t recipient@exmaple.com -s 'just a test mail' -a /path/to/attachment.pdf 'just a test mail'

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

python-sendmail-0.2.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

python_sendmail-0.2.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file python-sendmail-0.2.0.tar.gz.

File metadata

  • Download URL: python-sendmail-0.2.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for python-sendmail-0.2.0.tar.gz
Algorithm Hash digest
SHA256 16dd4cddb7598ccf38d986d596e0e4a9e91c706a713367d08cd03d22fa70aa72
MD5 db55433fa76e9cf0fdd611f815de7062
BLAKE2b-256 8f183b715b75c91f148ea0d36646548a1f653bb1b91213125cf919c8022cbb3c

See more details on using hashes here.

File details

Details for the file python_sendmail-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: python_sendmail-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for python_sendmail-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e9a379c259f8488af82b2c66fef88f6f3b78540feb7bb5a78ed8366b87e777e8
MD5 44537edb5b2906b491c5515047480637
BLAKE2b-256 d419e4201ad19a966b4ba3d63af51afd9a7cbcf80cd46ad4c550608f768b320c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page