Skip to main content

python-sendmail

Sendmail client. send mail via stmp server.

Install

pip install python-sendmail

Installed Command Lines

  • pysendmail

Help

test@test ~ % pysendmail --help
Usage: pysendmail [OPTIONS] [CONTENT]

  Send mail.

Options:
  -f, --from-address TEXT  Mail sender, e.g. Name <name@example.com> or
                           name@example.com.  [required]
  -t, --to-address TEXT    Mail recipients, e.g. Name <name@example.com> or
                           name@example.com.  [required]
  -s, --subject TEXT       Mail subject
  -a, --attach TEXT        Mail attachments, allow multiple use.
  --html                   Mail content is HTML format.
  -e, --encoding TEXT      Encoding of the mail content input.
  -c, --charset TEXT       Encoding of the mail content output.
  -h, --host TEXT          Mail server address, default to 127.0.0.1.
  -p, --port INTEGER       Mail server port, default to 25. If you are using
                           an ssl server, mostly the port should be 465.
  --ssl                    Mail server using ssl encryption.
  -u, --user TEXT          Mail server login account. Empty user means don't
                           use login.
  -P, --password TEXT      Mail server login password. Empty password means
                           don't use login.
  --verify                 Verify ssl certificate.
  --help                   Show this message and exit.

使用案例

Send mail with auth, without attachment.

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'

Send mail with attachment, without auth

  • Mail sender:sender@example.com
  • Mail recipient: recipient@exmaple.com
  • Subject:just a test mail
  • Content:just a test mail
  • Mail Server Address:127.0.0.1
  • Mail Server Port:25
  • Use ssl: No
  • Account: None
  • Password: None
  • Attachment: /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'

Releases

v0.3.5

  • Doc update.

v0.3.4

  • Doc update.

v0.3.3

  • Fix ssl context problem.
  • Add attach filename support.

v0.3.2

  • Add verify option. By default python-sendmail will ignore the ssl verify.

v0.3.1

  • Change help information to english.
  • Use new style to release.

v0.3.0

  • Old style release.

Release files for python-sendmail 0.3.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-sendmail 0.3.5
File Size Uploaded
python_sendmail-0.3.5.tar.gz 6.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-sendmail 0.3.5
File Interpreter ABI Platform
python_sendmail-0.3.5-py3-none-any.whl Python 3 none any Details

Total release size: 13.2 kB

Release files / python_sendmail-0.3.5.tar.gz

Download URL python_sendmail-0.3.5.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d2cfaf730f8877098c01b45d272eab04a3ec9bba19e8cdaa879c178249915457
BLAKE2b-256 checksum
How to use checksums
34f4c098258d7b47363725be4885a7bb9de7050c8e85a3403d52779be5bd7605
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.12

Release files / python_sendmail-0.3.5-py3-none-any.whl

Download URL python_sendmail-0.3.5-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
991442e3eeb09988cda8c4d134104e721d09bcd7088ed33484c27ac824f857b3
BLAKE2b-256 checksum
How to use checksums
983da3aad3537e690a2077ffa4baa457d94d88fcd23e6f03837a7d591640ac82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.12

Release history Release notifications | RSS feed

This release

0.3.5 This release

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

1 release file

0.3.0

1 release file

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page